Compare commits
No commits in common. "d2ac14a48f9eda5d52e44f8a160192267ac2bc72" and "c5d7d5f5594b4a0e77f7d3006ca5dfa13cbd14b3" have entirely different histories.
d2ac14a48f
...
c5d7d5f559
@ -169,6 +169,56 @@ class ApiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public function signup(Request $request)
|
||||||
|
// {
|
||||||
|
// $response = [];
|
||||||
|
|
||||||
|
// $rules = [
|
||||||
|
// 'name' => ['required', 'string', 'max:255'],
|
||||||
|
// 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||||
|
// 'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||||
|
// ];
|
||||||
|
|
||||||
|
// $validator = Validator::make($request->all(), $rules);
|
||||||
|
// if ($validator->fails()) {
|
||||||
|
// return response()->json(['validationError' => $validator->errors()], 422);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $user_data = [
|
||||||
|
// 'name' => $request->name,
|
||||||
|
// 'email' => $request->email,
|
||||||
|
// 'role' => 'student',
|
||||||
|
// 'status' => 1,
|
||||||
|
// 'password' => Hash::make($request->password),
|
||||||
|
// ];
|
||||||
|
|
||||||
|
// if (get_settings('student_email_verification') != 1) {
|
||||||
|
// $user_data['email_verified_at'] = now();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $user = User::create($user_data);
|
||||||
|
|
||||||
|
// if (get_settings('student_email_verification') == 1) {
|
||||||
|
// $user->sendEmailVerificationNotification();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if ($user) {
|
||||||
|
// $response = [
|
||||||
|
// 'success' => true,
|
||||||
|
// 'message' => 'User created successfully',
|
||||||
|
// ];
|
||||||
|
// } else {
|
||||||
|
// $response = [
|
||||||
|
// 'success' => false,
|
||||||
|
// 'message' => 'User creation failed',
|
||||||
|
// ];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// event(new Registered($user));
|
||||||
|
|
||||||
|
// return response()->json($response);
|
||||||
|
// }
|
||||||
|
|
||||||
//student logout function
|
//student logout function
|
||||||
public function logout(Request $request)
|
public function logout(Request $request)
|
||||||
{
|
{
|
||||||
@ -179,6 +229,30 @@ class ApiController extends Controller
|
|||||||
], 201);
|
], 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forgot password
|
||||||
|
// public function forgot_password(Request $request): RedirectResponse
|
||||||
|
// {
|
||||||
|
// $request->validate([
|
||||||
|
// 'email' => 'required|email',
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// // We will send the password reset link to this user. Once we have attempted
|
||||||
|
// // to send the link, we will examine the response then see the message we
|
||||||
|
// // need to show to the user. Finally, we'll send out a proper response.
|
||||||
|
// $status = Password::sendResetLink(
|
||||||
|
// $request->only('email')
|
||||||
|
// );
|
||||||
|
|
||||||
|
// if ($status == Password::RESET_LINK_SENT) {
|
||||||
|
// return back()->with('status', __($status));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// throw ValidationException::withMessages([
|
||||||
|
// 'email' => [trans($status)],
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
public function forgot_password(Request $request)
|
public function forgot_password(Request $request)
|
||||||
{
|
{
|
||||||
$response = [];
|
$response = [];
|
||||||
@ -200,6 +274,7 @@ class ApiController extends Controller
|
|||||||
return response()->json($response, 400);
|
return response()->json($response, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// update user data
|
// update user data
|
||||||
public function update_userdata(Request $request)
|
public function update_userdata(Request $request)
|
||||||
{
|
{
|
||||||
@ -256,6 +331,7 @@ class ApiController extends Controller
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
public function top_courses($top_course_id = "")
|
public function top_courses($top_course_id = "")
|
||||||
{
|
{
|
||||||
$query = Course::orderBy('id', 'desc')->where('status', 'active')->limit(10)->get();
|
$query = Course::orderBy('id', 'desc')->where('status', 'active')->limit(10)->get();
|
||||||
@ -310,13 +386,23 @@ class ApiController extends Controller
|
|||||||
$categories = array();
|
$categories = array();
|
||||||
$categories = sub_categories($request->category_id);
|
$categories = sub_categories($request->category_id);
|
||||||
|
|
||||||
|
// $response['sub_categories'] = $categories;
|
||||||
|
|
||||||
$response[0]['sub_categories'] = $categories;
|
$response[0]['sub_categories'] = $categories;
|
||||||
|
|
||||||
$courses = get_category_wise_courses($request->category_id);
|
$courses = get_category_wise_courses($request->category_id);
|
||||||
|
|
||||||
$response[0]['courses'] = course_data($courses);
|
$response[0]['courses'] = course_data($courses);
|
||||||
|
|
||||||
|
// foreach ($response as $key => $resp) {
|
||||||
|
// $response[$key]['sub_categories'] = $categories;
|
||||||
|
// }
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|
||||||
|
// $response['courses'] = $result;
|
||||||
|
|
||||||
|
// return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch all the categories
|
// Fetch all the categories
|
||||||
@ -354,6 +440,9 @@ class ApiController extends Controller
|
|||||||
// Filter course
|
// Filter course
|
||||||
public function filter_course(Request $request)
|
public function filter_course(Request $request)
|
||||||
{
|
{
|
||||||
|
// $courses = $this->api_model->filter_course();
|
||||||
|
// $this->set_response($courses, REST_Controller::HTTP_OK);
|
||||||
|
|
||||||
$selected_category = $request->selected_category;
|
$selected_category = $request->selected_category;
|
||||||
$selected_price = $request->selected_price;
|
$selected_price = $request->selected_price;
|
||||||
$selected_level = $request->selected_level;
|
$selected_level = $request->selected_level;
|
||||||
@ -361,6 +450,8 @@ class ApiController extends Controller
|
|||||||
$selected_rating = $request->selected_rating;
|
$selected_rating = $request->selected_rating;
|
||||||
$selected_search_string = ltrim(rtrim($request->selected_search_string));
|
$selected_search_string = ltrim(rtrim($request->selected_search_string));
|
||||||
|
|
||||||
|
// $course_ids = array();
|
||||||
|
|
||||||
$query = Course::query();
|
$query = Course::query();
|
||||||
|
|
||||||
if ($selected_search_string != "" && $selected_search_string != "null") {
|
if ($selected_search_string != "" && $selected_search_string != "null") {
|
||||||
@ -390,6 +481,21 @@ class ApiController extends Controller
|
|||||||
$query->where('status', 'active');
|
$query->where('status', 'active');
|
||||||
$courses = $query->get();
|
$courses = $query->get();
|
||||||
|
|
||||||
|
// foreach ($courses as $course) {
|
||||||
|
// if ($selected_rating != "all") {
|
||||||
|
// $total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;
|
||||||
|
// $number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();
|
||||||
|
// if ($number_of_ratings > 0) {
|
||||||
|
// $average_ceil_rating = ceil($total_rating / $number_of_ratings);
|
||||||
|
// if ($average_ceil_rating == $selected_rating) {
|
||||||
|
// array_push($course_ids, $course['id']);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// array_push($course_ids, $course['id']);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// This block of codes return the required data of courses
|
// This block of codes return the required data of courses
|
||||||
$result = array();
|
$result = array();
|
||||||
$result = course_data($courses);
|
$result = course_data($courses);
|
||||||
@ -495,6 +601,8 @@ class ApiController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$response = array();
|
$response = array();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
@ -785,4 +893,11 @@ class ApiController extends Controller
|
|||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,12 +86,6 @@ class RegisteredUserController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start database transaction for the entire registration process
|
|
||||||
$user = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
$user_data = [
|
$user_data = [
|
||||||
'name' => $request->name,
|
'name' => $request->name,
|
||||||
'email' => $request->email,
|
'email' => $request->email,
|
||||||
@ -109,29 +103,13 @@ class RegisteredUserController extends Controller
|
|||||||
|
|
||||||
// If applying as an instructor, process the application
|
// If applying as an instructor, process the application
|
||||||
if ($request->has('instructor')) {
|
if ($request->has('instructor')) {
|
||||||
$result = $this->processInstructorApplication($request, $user);
|
return $this->processInstructorApplication($request, $user);
|
||||||
if ($result instanceof RedirectResponse && $result->getSession()->get('error')) {
|
|
||||||
// If there was an error in instructor application, rollback
|
|
||||||
DB::rollBack();
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DB::commit();
|
|
||||||
|
|
||||||
// Log the user in after successful registration
|
// Log the user in after successful registration
|
||||||
Auth::login($user);
|
Auth::login($user);
|
||||||
|
|
||||||
return redirect(RouteServiceProvider::HOME);
|
return redirect(RouteServiceProvider::HOME);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
if (DB::transactionLevel() > 0) {
|
|
||||||
DB::rollBack();
|
|
||||||
}
|
|
||||||
|
|
||||||
Log::error('Registration error:', ['error' => $e->getMessage()]);
|
|
||||||
Session::flash('error', get_phrase('Error during registration. Please try again.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function processInstructorApplication(Request $request, User $user): RedirectResponse
|
private function processInstructorApplication(Request $request, User $user): RedirectResponse
|
||||||
@ -142,18 +120,9 @@ class RegisteredUserController extends Controller
|
|||||||
return redirect()->route('become.instructor');
|
return redirect()->route('become.instructor');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if NIDN already exists in Instructors table with status = 1 (active)
|
try {
|
||||||
$nidn = $request->nidn;
|
|
||||||
$existingInstructor = Instructors::where('nidn', $nidn)
|
|
||||||
->where('status', 1)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($existingInstructor) {
|
|
||||||
Session::flash('error', get_phrase('This NIDN is already registered as an active instructor.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check NIDN with the API
|
// Check NIDN with the API
|
||||||
|
$nidn = $request->nidn;
|
||||||
$api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1";
|
$api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1";
|
||||||
|
|
||||||
$response = Http::timeout(30)->get($api_url);
|
$response = Http::timeout(30)->get($api_url);
|
||||||
@ -168,11 +137,13 @@ class RegisteredUserController extends Controller
|
|||||||
if (!isset($data['ok']) || !isset($data['matched_dosen']) || count($data['matched_dosen']) == 0) {
|
if (!isset($data['ok']) || !isset($data['matched_dosen']) || count($data['matched_dosen']) == 0) {
|
||||||
Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.'));
|
Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.'));
|
||||||
return redirect()->back()->withInput();
|
return redirect()->back()->withInput();
|
||||||
} else if (strtolower($matched_dosen['nama']) != strtolower($user->name)) {
|
}else if ($matched_dosen['nama'] != $user->name){
|
||||||
Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.'));
|
Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.'));
|
||||||
return redirect()->back()->withInput();
|
return redirect()->back()->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::info('API Response for Nama: ' . $matched_dosen['nama'], ' || nama :',$user->name);
|
||||||
|
|
||||||
// Prepare instructor data - adjust fields according to your database
|
// Prepare instructor data - adjust fields according to your database
|
||||||
$instructor = [
|
$instructor = [
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
@ -180,8 +151,7 @@ class RegisteredUserController extends Controller
|
|||||||
'name' => $matched_dosen['nama'] ?? $user->name,
|
'name' => $matched_dosen['nama'] ?? $user->name,
|
||||||
'id_sdm' => $matched_dosen['id'] ?? null,
|
'id_sdm' => $matched_dosen['id'] ?? null,
|
||||||
'id_sms' => $matched_dosen['nama_prodi'] ?? null,
|
'id_sms' => $matched_dosen['nama_prodi'] ?? null,
|
||||||
'id_pt' => $matched_dosen['nama_pt'] ?? null,
|
'id_pt' => $matched_dosen['nama_pt'] ?? null
|
||||||
'status' => 0
|
|
||||||
];
|
];
|
||||||
|
|
||||||
Log::info('Instructor data to be saved:', $instructor);
|
Log::info('Instructor data to be saved:', $instructor);
|
||||||
@ -204,11 +174,25 @@ class RegisteredUserController extends Controller
|
|||||||
'description' => $request->description
|
'description' => $request->description
|
||||||
];
|
];
|
||||||
|
|
||||||
// Create both application and instructor records
|
// Start database transaction to ensure both records are saved
|
||||||
|
DB::transaction(function () use ($application, $instructor) {
|
||||||
Application::create($application);
|
Application::create($application);
|
||||||
Instructors::create($instructor);
|
Instructors::create($instructor);
|
||||||
|
});
|
||||||
|
|
||||||
Session::flash('success', get_phrase('Your application has been submitted successfully.'));
|
Session::flash('success', get_phrase('Your application has been submitted successfully.'));
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error('Instructor registration error:', [
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'error' => $e->getMessage(),
|
||||||
|
'trace' => $e->getTraceAsString()
|
||||||
|
]);
|
||||||
|
|
||||||
|
Session::flash('error', get_phrase('Error while processing your application. Please try again later!'));
|
||||||
|
return redirect()->back()->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
return redirect(RouteServiceProvider::HOME);
|
return redirect(RouteServiceProvider::HOME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||||||
use App\Models\Application;
|
use App\Models\Application;
|
||||||
use App\Models\Course;
|
use App\Models\Course;
|
||||||
use App\Models\Enrollment;
|
use App\Models\Enrollment;
|
||||||
use App\Models\Instructors;
|
|
||||||
use App\Models\FileUploader;
|
use App\Models\FileUploader;
|
||||||
use App\Models\Payout;
|
use App\Models\Payout;
|
||||||
use App\Models\Permission;
|
use App\Models\Permission;
|
||||||
@ -17,11 +16,10 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Response;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class UsersController extends Controller
|
class UsersController extends Controller
|
||||||
{
|
{
|
||||||
@ -44,28 +42,12 @@ class UsersController extends Controller
|
|||||||
public function admin_store(Request $request)
|
public function admin_store(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), [
|
$validated = $request->validate([
|
||||||
'name' => "required|max:255",
|
'name' => "required",
|
||||||
'email' => 'required|email|unique:users',
|
'email' => 'required|email|unique:users',
|
||||||
'password' => "required|min:8",
|
'password' => "required|min:8",
|
||||||
], [
|
|
||||||
'name.required' => get_phrase('Name is required'),
|
|
||||||
'name.string' => get_phrase('Name must be a valid text'),
|
|
||||||
'name.max' => get_phrase('Name may not be greater than 255 characters'),
|
|
||||||
'email.required' => get_phrase('Email is required'),
|
|
||||||
'email.string' => get_phrase('Email must be a valid text'),
|
|
||||||
'email.email' => get_phrase('Please enter a valid email address'),
|
|
||||||
'email.unique' => get_phrase('This email is already registered. Please use a different email.'),
|
|
||||||
'password.required' => get_phrase('Password is required'),
|
|
||||||
'password.min' => get_phrase('Password must be at least 8 characters'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
|
||||||
$firstError = $validator->errors()->first();
|
|
||||||
Session::flash('error', $firstError);
|
|
||||||
return redirect()->back()->withErrors($validator)->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['name'] = $request->name;
|
$data['name'] = $request->name;
|
||||||
$data['about'] = $request->about;
|
$data['about'] = $request->about;
|
||||||
$data['phone'] = $request->phone;
|
$data['phone'] = $request->phone;
|
||||||
@ -108,8 +90,6 @@ class UsersController extends Controller
|
|||||||
'email' => "required|email|unique:users,email,$id",
|
'email' => "required|email|unique:users,email,$id",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
$data['name'] = $request->name;
|
$data['name'] = $request->name;
|
||||||
$data['about'] = $request->about;
|
$data['about'] = $request->about;
|
||||||
$data['phone'] = $request->phone;
|
$data['phone'] = $request->phone;
|
||||||
@ -196,49 +176,21 @@ class UsersController extends Controller
|
|||||||
}
|
}
|
||||||
public function instructor_edit($id = '')
|
public function instructor_edit($id = '')
|
||||||
{
|
{
|
||||||
$page_data['instructor'] = User::where('users.id', $id)
|
$page_data['instructor'] = User::where('id', $id)->first();
|
||||||
->leftJoin('instructors', 'users.id', '=', 'instructors.user_id')
|
|
||||||
->select('users.*', 'instructors.nidn', 'instructors.status', 'instructors.id_sdm', 'instructors.id_sms', 'instructors.id_pt')
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$page_data['instructor']) {
|
|
||||||
Session::flash('error', get_phrase('Instructor not found'));
|
|
||||||
return redirect()->route('admin.instructor.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('admin.instructor.edit_instructor', $page_data);
|
return view('admin.instructor.edit_instructor', $page_data);
|
||||||
}
|
}
|
||||||
public function instructor_store(Request $request, $id = '')
|
public function instructor_store(Request $request, $id = '')
|
||||||
{
|
{
|
||||||
$validator = Validator::make($request->all(), [
|
$validated = $request->validate([
|
||||||
'name' => "required|max:255",
|
'name' => "required|max:255",
|
||||||
'email' => 'required|email|unique:users',
|
'email' => 'required|email|unique:users',
|
||||||
'password' => "required|min:8",
|
'password' => "required|min:8",
|
||||||
'nidn' => "required"
|
|
||||||
], [
|
|
||||||
'name.required' => get_phrase('Name is required'),
|
|
||||||
'name.string' => get_phrase('Name must be a valid text'),
|
|
||||||
'name.max' => get_phrase('Name may not be greater than 255 characters'),
|
|
||||||
'email.required' => get_phrase('Email is required'),
|
|
||||||
'email.string' => get_phrase('Email must be a valid text'),
|
|
||||||
'email.email' => get_phrase('Please enter a valid email address'),
|
|
||||||
'email.unique' => get_phrase('This email is already registered. Please use a different email.'),
|
|
||||||
'password.required' => get_phrase('Password is required'),
|
|
||||||
'password.min' => get_phrase('Password must be at least 8 characters'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
|
||||||
$firstError = $validator->errors()->first();
|
|
||||||
Session::flash('error', $firstError);
|
|
||||||
return redirect()->back()->withErrors($validator)->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(get_settings('student_email_verification') != 1){
|
if(get_settings('student_email_verification') != 1){
|
||||||
$data['email_verified_at'] = date('Y-m-d H:i:s');
|
$data['email_verified_at'] = date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
$data['name'] = $request->name;
|
$data['name'] = $request->name;
|
||||||
$data['about'] = $request->about;
|
$data['about'] = $request->about;
|
||||||
$data['phone'] = $request->phone;
|
$data['phone'] = $request->phone;
|
||||||
@ -261,56 +213,7 @@ class UsersController extends Controller
|
|||||||
FileUploader::upload($request->photo, $path, 400, null, 200, 200);
|
FileUploader::upload($request->photo, $path, 400, null, 200, 200);
|
||||||
$data['photo'] = $path;
|
$data['photo'] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if NIDN already exists in Instructors table with status = 1 (active)
|
|
||||||
$nidn = $request->nidn;
|
|
||||||
$existingInstructor = Instructors::where('nidn', $nidn)
|
|
||||||
->where('status', 1)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($existingInstructor) {
|
|
||||||
Session::flash('error', get_phrase('This NIDN is already registered as an active instructor.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1";
|
|
||||||
|
|
||||||
$response = Http::timeout(30)->get($api_url);
|
|
||||||
$apiResponse = $response->json();
|
|
||||||
|
|
||||||
Log::info('API Response for NIDN: ' . $nidn, ['response' => $apiResponse]);
|
|
||||||
|
|
||||||
// Extract matched dosen data
|
|
||||||
$matched_dosen = $apiResponse['matched_dosen'][0];
|
|
||||||
Log::info('Instructor data to be saved:', $matched_dosen);
|
|
||||||
|
|
||||||
if (!isset($apiResponse['ok']) || !isset($apiResponse['matched_dosen']) || count($apiResponse['matched_dosen']) == 0) {
|
|
||||||
Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}else if (strtolower($matched_dosen['nama']) != strtolower($request->name)) {
|
|
||||||
Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}
|
|
||||||
$user = User::create($data);
|
$user = User::create($data);
|
||||||
// Prepare instructor data - adjust fields according to your database
|
|
||||||
$instructor = [
|
|
||||||
'user_id' => $user->id,
|
|
||||||
'nidn' => $nidn,
|
|
||||||
'name' => $matched_dosen['nama'] ?? null,
|
|
||||||
'id_sdm' => $matched_dosen['id'] ?? null,
|
|
||||||
'id_sms' => $matched_dosen['nama_prodi'] ?? null,
|
|
||||||
'id_pt' => $matched_dosen['nama_pt'] ?? null
|
|
||||||
];
|
|
||||||
|
|
||||||
Log::info('Instructor data to be saved:', $instructor);
|
|
||||||
|
|
||||||
Instructors::create($instructor);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
Log::error('Error storing NIDN for admin: ' . $e->getMessage());
|
|
||||||
Session::flash('error', get_phrase('There was an error processing the NIDN. Please try again.'));
|
|
||||||
return redirect()->back()->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(get_settings('student_email_verification') == 1) {
|
if(get_settings('student_email_verification') == 1) {
|
||||||
$user->sendEmailVerificationNotification();
|
$user->sendEmailVerificationNotification();
|
||||||
@ -329,9 +232,6 @@ class UsersController extends Controller
|
|||||||
'email' => "required|email|unique:users,email,$id",
|
'email' => "required|email|unique:users,email,$id",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [];
|
|
||||||
$data_instructor = [];
|
|
||||||
|
|
||||||
$data['name'] = $request->name;
|
$data['name'] = $request->name;
|
||||||
$data['about'] = $request->about;
|
$data['about'] = $request->about;
|
||||||
$data['phone'] = $request->phone;
|
$data['phone'] = $request->phone;
|
||||||
@ -343,12 +243,6 @@ class UsersController extends Controller
|
|||||||
$data['linkedin'] = $request->linkedin;
|
$data['linkedin'] = $request->linkedin;
|
||||||
$data['paymentkeys'] = json_encode($request->paymentkeys);
|
$data['paymentkeys'] = json_encode($request->paymentkeys);
|
||||||
|
|
||||||
$data_instructor['nidn'] = $request->nidn;
|
|
||||||
$data_instructor['status'] = $request->status ?? 0;
|
|
||||||
$data_instructor['id_sdm'] = $request->id_sdm;
|
|
||||||
$data_instructor['id_sms'] = $request->id_sms;
|
|
||||||
$data_instructor['id_pt'] = $request->id_pt;
|
|
||||||
|
|
||||||
if (isset($request->photo) && $request->hasFile('photo')) {
|
if (isset($request->photo) && $request->hasFile('photo')) {
|
||||||
remove_file(User::where('id', $id)->first()->photo);
|
remove_file(User::where('id', $id)->first()->photo);
|
||||||
$path = "uploads/users/instructor/" . nice_file_name($request->name, $request->photo->extension());
|
$path = "uploads/users/instructor/" . nice_file_name($request->name, $request->photo->extension());
|
||||||
@ -357,7 +251,6 @@ class UsersController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
User::where('id', $id)->update($data);
|
User::where('id', $id)->update($data);
|
||||||
Instructors::where('user_id', $id)->update($data_instructor);
|
|
||||||
Session::flash('success', get_phrase('Instructor update successfully'));
|
Session::flash('success', get_phrase('Instructor update successfully'));
|
||||||
return redirect()->route('admin.instructor.index');
|
return redirect()->route('admin.instructor.index');
|
||||||
}
|
}
|
||||||
@ -522,40 +415,15 @@ class UsersController extends Controller
|
|||||||
{
|
{
|
||||||
return view('admin.instructor.application');
|
return view('admin.instructor.application');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function instructor_application_approve($id)
|
public function instructor_application_approve($id)
|
||||||
{
|
{
|
||||||
$application = Application::find($id);
|
$query = Application::where('id', $id);
|
||||||
|
$update_status = $query->update(['status' => 1]);
|
||||||
if (!$application) {
|
if ($update_status) {
|
||||||
Session::flash('error', get_phrase('Application not found'));
|
$user_id = $query->first();
|
||||||
return redirect()->back();
|
User::where('id', $user_id->user_id)->update(['role' => 'instructor']);
|
||||||
|
Session::flash('success', get_phrase('Application approve successfully'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
DB::beginTransaction();
|
|
||||||
|
|
||||||
// Update application status
|
|
||||||
$application->status = 1;
|
|
||||||
$application->save();
|
|
||||||
|
|
||||||
$user_id = $application->user_id;
|
|
||||||
|
|
||||||
// Update user role to instructor
|
|
||||||
User::where('id', $user_id)->update(['role' => 'instructor']);
|
|
||||||
|
|
||||||
// Update instructor status to 1 (active)
|
|
||||||
Instructors::where('user_id', $user_id)->update(['status' => 1]);
|
|
||||||
|
|
||||||
DB::commit();
|
|
||||||
Session::flash('success', get_phrase('Application approved successfully'));
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
DB::rollBack();
|
|
||||||
Log::error('Application approval error:', ['error' => $e->getMessage()]);
|
|
||||||
Session::flash('error', get_phrase('Failed to approve application'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
public function instructor_application_delete($id)
|
public function instructor_application_delete($id)
|
||||||
@ -614,28 +482,12 @@ class UsersController extends Controller
|
|||||||
}
|
}
|
||||||
public function student_store(Request $request, $id = '')
|
public function student_store(Request $request, $id = '')
|
||||||
{
|
{
|
||||||
$validator = Validator::make($request->all(), [
|
$validated = $request->validate([
|
||||||
'name' => "required|max:255",
|
'name' => 'required|max:255',
|
||||||
'email' => 'required|email|unique:users',
|
'email' => 'required|email|unique:users',
|
||||||
'password' => "required|min:8",
|
'password' => 'required',
|
||||||
], [
|
|
||||||
'name.required' => get_phrase('Name is required'),
|
|
||||||
'name.string' => get_phrase('Name must be a valid text'),
|
|
||||||
'name.max' => get_phrase('Name may not be greater than 255 characters'),
|
|
||||||
'email.required' => get_phrase('Email is required'),
|
|
||||||
'email.string' => get_phrase('Email must be a valid text'),
|
|
||||||
'email.email' => get_phrase('Please enter a valid email address'),
|
|
||||||
'email.unique' => get_phrase('This email is already registered. Please use a different email.'),
|
|
||||||
'password.required' => get_phrase('Password is required'),
|
|
||||||
'password.min' => get_phrase('Password must be at least 8 characters'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
|
||||||
$firstError = $validator->errors()->first();
|
|
||||||
Session::flash('error', $firstError);
|
|
||||||
return redirect()->back()->withErrors($validator)->withInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(get_settings('student_email_verification') != 1){
|
if(get_settings('student_email_verification') != 1){
|
||||||
$data['email_verified_at'] = date('Y-m-d H:i:s');
|
$data['email_verified_at'] = date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
@ -803,6 +655,7 @@ class UsersController extends Controller
|
|||||||
{
|
{
|
||||||
if ($request->type == 'general') {
|
if ($request->type == 'general') {
|
||||||
$profile['name'] = $request->name;
|
$profile['name'] = $request->name;
|
||||||
|
$profile['email'] = $request->email;
|
||||||
$profile['facebook'] = $request->facebook;
|
$profile['facebook'] = $request->facebook;
|
||||||
$profile['linkedin'] = $request->linkedin;
|
$profile['linkedin'] = $request->linkedin;
|
||||||
$profile['twitter'] = $request->twitter;
|
$profile['twitter'] = $request->twitter;
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace App\Http\Controllers\instructor;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\FileUploader;
|
use App\Models\FileUploader;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Instructors;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
@ -18,29 +17,13 @@ class MyProfileController extends Controller
|
|||||||
{
|
{
|
||||||
public function manage_profile()
|
public function manage_profile()
|
||||||
{
|
{
|
||||||
// Get current authenticated user
|
return view('instructor.profile.index');
|
||||||
$user = Auth::user();
|
|
||||||
|
|
||||||
// Get instructor data based on user_id
|
|
||||||
$instructor = Instructors::where('user_id', $user->id)->first();
|
|
||||||
|
|
||||||
// Merge instructor data into user object
|
|
||||||
if ($instructor) {
|
|
||||||
$user->nidn = $instructor->nidn;
|
|
||||||
$user->id_sdm = $instructor->id_sdm;
|
|
||||||
$user->id_sms = $instructor->id_sms;
|
|
||||||
$user->id_pt = $instructor->id_pt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('instructor.profile.index', [
|
|
||||||
'auth' => $user
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function manage_profile_update(Request $request)
|
public function manage_profile_update(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->type == 'general') {
|
if ($request->type == 'general') {
|
||||||
$profile['name'] = $request->name;
|
$profile['name'] = $request->name;
|
||||||
|
$profile['email'] = $request->email;
|
||||||
$profile['facebook'] = $request->facebook;
|
$profile['facebook'] = $request->facebook;
|
||||||
$profile['twitter'] = $request->twitter;
|
$profile['twitter'] = $request->twitter;
|
||||||
$profile['linkedin'] = $request->linkedin;
|
$profile['linkedin'] = $request->linkedin;
|
||||||
|
|||||||
@ -5,37 +5,19 @@ namespace App\Http\Controllers\student;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\FileUploader;
|
use App\Models\FileUploader;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Instructors;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
|
|
||||||
class MyProfileController extends Controller
|
class MyProfileController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$user = User::find(auth()->user()->id);
|
$page_data['user_details'] = User::find(auth()->user()->id);
|
||||||
// Check if the role is 'instructor'
|
|
||||||
if ($user->role === 'instructor') {
|
|
||||||
// Retrieve the instructor details associated with the user
|
|
||||||
$instructor = Instructors::where('user_id', $user->id)->first();
|
|
||||||
|
|
||||||
// Check if the instructor exists to avoid errors when accessing properties
|
|
||||||
if ($instructor) {
|
|
||||||
$user->nidn = $instructor->nidn;
|
|
||||||
$user->id_sdm = $instructor->id_sdm;
|
|
||||||
$user->id_sms = $instructor->id_sms;
|
|
||||||
$user->id_pt = $instructor->id_pt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$page_data['user_details'] = $user;
|
|
||||||
$view_path = 'frontend.' . get_frontend_settings('theme') . '.student.my_profile.index';
|
$view_path = 'frontend.' . get_frontend_settings('theme') . '.student.my_profile.index';
|
||||||
|
|
||||||
return view($view_path, $page_data);
|
return view($view_path, $page_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +34,7 @@ class MyProfileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data['name'] = $request->name;
|
$data['name'] = $request->name;
|
||||||
|
$data['email'] = $request->email;
|
||||||
$data['phone'] = $request->phone;
|
$data['phone'] = $request->phone;
|
||||||
$data['website'] = $request->website;
|
$data['website'] = $request->website;
|
||||||
$data['facebook'] = $request->facebook;
|
$data['facebook'] = $request->facebook;
|
||||||
|
|||||||
@ -10,6 +10,6 @@ class Instructors extends Model
|
|||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'user_id', 'nidn', 'id_sdm', 'id_sms', 'id_pt', 'status'
|
'user_id', 'nidn', 'id_sdm', 'id_sms', 'id_pt'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($instructor->name) value="{{ $instructor->name }}" @else value="{{ old('name') }}" @endisset required>
|
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($instructor->name) value="{{ $instructor->name }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -9,7 +9,10 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description"> @isset($instructor->about){{ $instructor->about }}@else{{ old('about') }}@endisset</textarea>
|
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description">
|
||||||
|
@isset($instructor->about)
|
||||||
|
{{ $instructor->about }}
|
||||||
|
@endisset
|
||||||
</textarea>
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -17,14 +20,14 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="number" name="phone" class="form-control ol-form-control" id="user-phone" @isset($instructor->phone) value="{{ $instructor->phone }}" @else value="{{ old('phone') }}" @endisset>
|
<input type="text" name="phone" class="form-control ol-form-control" id="user-phone" @isset($instructor->phone) value="{{ $instructor->phone }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($instructor->address) value="{{ $instructor->address }}" @else value="{{ old('address') }}" @endisset>
|
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($instructor->address) value="{{ $instructor->address }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span
|
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span
|
||||||
class="text-danger ms-1">*</span></label>
|
class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($instructor->email) value="{{ $instructor->email }}" @else value="{{ old('email') }}" @endisset required>
|
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($instructor->email) value="{{ $instructor->email }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="facebook" class="form-control ol-form-control" id="title"
|
<input type="text" name="facebook" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->facebook) value="{{ $instructor->facebook }}" @else value="{{ old('facebook') }}" @endisset>
|
@isset($instructor->facebook) value="{{ $instructor->facebook }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -10,13 +10,13 @@
|
|||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="twitter" class="form-control ol-form-control" id="title"
|
<input type="text" name="twitter" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->twitter) value="{{ $instructor->twitter }}" @else value="{{ old('twitter') }}" @endisset>
|
@isset($instructor->twitter) value="{{ $instructor->twitter }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="linkedin" class="form-control ol-form-control" id="title"
|
<input type="text" name="linkedin" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->linkedin) value="{{ $instructor->linkedin }}" @else value="{{ old('linkedin') }}" @endisset>
|
@isset($instructor->linkedin) value="{{ $instructor->linkedin }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -128,33 +128,5 @@
|
|||||||
$('#preview_' + img_type).attr('src', x);
|
$('#preview_' + img_type).attr('src', x);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -178,44 +178,5 @@
|
|||||||
$('#preview_' + img_type).attr('src', x);
|
$('#preview_' + img_type).attr('src', x);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('og_image').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -171,19 +171,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
//End progress
|
//End progress
|
||||||
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -38,19 +38,5 @@
|
|||||||
$('#preview_' + img_type).attr('src', x);
|
$('#preview_' + img_type).attr('src', x);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -30,11 +30,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="thumbnail" class="form-label ol-form-label">{{ get_phrase('Choose category thumbnail') }} <small class="text-muted">({{ get_phrase('optional') }})</small></label>
|
<label for="thumbnail" class="form-label ol-form-label">{{ get_phrase('Thumbnail') }} <small class="text-muted">({{ get_phrase('optional') }})</small></label>
|
||||||
<input type="file" name="thumbnail" class="form-control ol-form-control" id="thumbnail" accept="image/*" />
|
<input type="file" name="thumbnail" class="form-control ol-form-control" id="thumbnail" accept="image/*" />
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="category_logo" class="form-label ol-form-label">{{ get_phrase('Choose category Logo') }} <small class="text-muted">({{ get_phrase('optional') }})</small></label>
|
<label for="category_logo" class="form-label ol-form-label">{{ get_phrase('Category logo') }} <small class="text-muted">({{ get_phrase('optional') }})</small></label>
|
||||||
<input type="file" name="category_logo" class="form-control ol-form-control" id="category_logo" accept="image/*" />
|
<input type="file" name="category_logo" class="form-control ol-form-control" id="category_logo" accept="image/*" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -54,31 +54,4 @@
|
|||||||
$('.icon-picker').iconpicker();
|
$('.icon-picker').iconpicker();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Define the file size limit in bytes (2 MB)
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get translated phrases from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
// Validate thumbnail file size
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage);
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Validate category logo file size
|
|
||||||
document.getElementById('category_logo').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage);
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -65,32 +65,4 @@
|
|||||||
$('.ol-select2').select2({
|
$('.ol-select2').select2({
|
||||||
dropdownParent: $("#ajaxModal")
|
dropdownParent: $("#ajaxModal")
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('category_logo').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -240,18 +240,5 @@
|
|||||||
$('#number_of_month').slideDown();
|
$('#number_of_month').slideDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -18,34 +18,3 @@
|
|||||||
<input type="file" name="preview" class="form-control ol-form-control" id="preview" accept="video/*" />
|
<input type="file" name="preview" class="form-control ol-form-control" id="preview" accept="video/*" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -43,34 +43,3 @@
|
|||||||
<small class="text-muted">{{get_phrase('Supported Video file')}}: <b>.{{get_phrase('mp4')}}</b> {{get_phrase('or')}} <b>.{{get_phrase('webm')}}</b> {{get_phrase('or')}} <b>.{{get_phrase('ogg')}}</b></small>
|
<small class="text-muted">{{get_phrase('Supported Video file')}}: <b>.{{get_phrase('mp4')}}</b> {{get_phrase('or')}} <b>.{{get_phrase('webm')}}</b> {{get_phrase('or')}} <b>.{{get_phrase('ogg')}}</b></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -35,17 +35,4 @@
|
|||||||
<script>
|
<script>
|
||||||
"use strict";
|
"use strict";
|
||||||
initializeDurationPickers([".duration_picker"]);
|
initializeDurationPickers([".duration_picker"]);
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@ -33,20 +33,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
initializeDurationPickers([".duration_picker"]);
|
initializeDurationPickers([".duration_picker"]);
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($instructor->name) value="{{ $instructor->name }}" @else value="{{ old('name') }}" @endisset required>
|
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($instructor->name) value="{{ $instructor->name }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description"> @isset($instructor->about){{ $instructor->about }}@else{{ old('about') }}@endisset</textarea>
|
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description">@isset($instructor->about){{ $instructor->about }}@endisset</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -17,14 +17,14 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="number" name="phone" class="form-control ol-form-control" id="user-phone" @isset($instructor->phone) value="{{ $instructor->phone }}" @else value="{{ old('phone') }}" @endisset>
|
<input type="text" name="phone" class="form-control ol-form-control" id="user-phone" @isset($instructor->phone) value="{{ $instructor->phone }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($instructor->address) value="{{ $instructor->address }}" @else value="{{ old('address') }}" @endisset>
|
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($instructor->address) value="{{ $instructor->address }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
@ -33,10 +33,3 @@
|
|||||||
<input type="file" name="photo" class="form-control ol-form-control" id="photo">
|
<input type="file" name="photo" class="form-control ol-form-control" id="photo">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-nidn" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('NIDN') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="number" name="nidn" class="form-control ol-form-control" id="user-nidn" @isset($instructor->nidn) value="{{ $instructor->nidn }}" @else value="{{ old('nidn') }}" @endisset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|||||||
@ -2,15 +2,15 @@
|
|||||||
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span
|
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span
|
||||||
class="text-danger ms-1">*</span></label>
|
class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($instructor->email) value="{{ $instructor->email }}" @else value="{{ old('email') }}" @endisset required>
|
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($instructor->email) value="{{ $instructor->email }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-sm-8 offset-sm-2">
|
<div class="col-sm-8 offset-sm-2">
|
||||||
<input type="hidden" name="email_verified" value="1" id="email_verified_value">
|
<input type="hidden" name="email_verified" value="0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="checkbox" class="form-check-input" id="email_verified_checkbox" name="email_verified" value="1" {{ old('email_verified', isset($instructor->email) ? ($instructor->email_verified_at ? 'checked' : '') : 'checked') ? 'checked' : '' }}>
|
<input type="checkbox" class="form-check-input" id="email_verified" name="email_verified" value="1">
|
||||||
<label class="form-check-label" for="email_verified_checkbox">{{ get_phrase('Mark email as verified') }}</label>
|
<label class="form-check-label" for="email_verified">{{ get_phrase('Mark email as verified') }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -24,18 +24,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endisset
|
@endisset
|
||||||
|
|
||||||
<script>
|
|
||||||
// Get the checkbox and the hidden input
|
|
||||||
const checkbox = document.getElementById('email_verified_checkbox');
|
|
||||||
const hiddenInput = document.getElementById('email_verified_value');
|
|
||||||
|
|
||||||
// Update hidden input value when the checkbox is toggled
|
|
||||||
checkbox.addEventListener('change', function() {
|
|
||||||
if (checkbox.checked) {
|
|
||||||
hiddenInput.value = '1'; // Checked, set value to 1
|
|
||||||
} else {
|
|
||||||
hiddenInput.value = '0'; // Unchecked, set value to 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="facebook" class="form-control ol-form-control" id="title"
|
<input type="text" name="facebook" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->facebook) value="{{ $instructor->facebook }}" @else value="{{ old('facebook') }}" @endisset>
|
@isset($instructor->facebook) value="{{ $instructor->facebook }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -10,13 +10,13 @@
|
|||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="twitter" class="form-control ol-form-control" id="title"
|
<input type="text" name="twitter" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->twitter) value="{{ $instructor->twitter }}" @else value="{{ old('twitter') }}" @endisset>
|
@isset($instructor->twitter) value="{{ $instructor->twitter }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="linkedin" class="form-control ol-form-control" id="title"
|
<input type="text" name="linkedin" class="form-control ol-form-control" id="title"
|
||||||
@isset($instructor->linkedin) value="{{ $instructor->linkedin }}" @else value="{{ old('linkedin') }}" @endisset>
|
@isset($instructor->linkedin) value="{{ $instructor->linkedin }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -33,39 +33,3 @@
|
|||||||
<input type="file" name="photo" class="form-control ol-form-control" id="photo">
|
<input type="file" name="photo" class="form-control ol-form-control" id="photo">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-nidn" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('NIDN') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="number" name="nidn" class="form-control ol-form-control" id="user-nidn" @isset($instructor->nidn) value="{{ $instructor->nidn }}" @endisset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-id_sdm" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('ID_SDM') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" name="id_sdm" class="form-control ol-form-control" id="user-id_sdm" @isset($instructor->id_sdm) value="{{ $instructor->id_sdm }}" @endisset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-id_sms" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('ID_SMS') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" name="id_sms" class="form-control ol-form-control" id="user-id_sms" @isset($instructor->id_sms) value="{{ $instructor->id_sms }}" @endisset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-id_pt" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('ID_PT') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" name="id_pt" class="form-control ol-form-control" id="user-id_pt" @isset($instructor->id_pt) value="{{ $instructor->id_pt }}" @endisset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<label for="user-status" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Status') }}</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="hidden" name="status" value="0">
|
|
||||||
<div class="form-check">
|
|
||||||
<input type="checkbox" class="form-check-input" id="status_checkbox" name="status" value="1"
|
|
||||||
{{ isset($instructor) && $instructor->status == 1 ? 'checked' : '' }}>
|
|
||||||
<label class="form-check-label" for="status_checkbox">{{ get_phrase('Checked if the instructor is active') }}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<div class="fpb7 mb-2">
|
<div class="fpb7 mb-2">
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('Email') }}</label>
|
<label class="form-label ol-form-label">{{ get_phrase('Email') }}</label>
|
||||||
<input type="email" class="form-control ol-form-control" name="email" value="{{ $auth->email }}" disabled readonly />
|
<input type="email" class="form-control ol-form-control" name="email" value="{{ $auth->email }}" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fpb7 mb-2">
|
<div class="fpb7 mb-2">
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span class="text-danger ms-1">*</span></label>
|
<label for="email" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Email') }}<span class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($student->email) value="{{ $student->email }}" @else value="{{ old('email') }}" @endisset required>
|
<input type="email" name="email" class="form-control ol-form-control" id="email" @isset($student->email) value="{{ $instructor->email }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-sm-8 offset-sm-2">
|
<div class="col-sm-8 offset-sm-2">
|
||||||
<input type="hidden" name="email_verified" value="1" id="email_verified_value">
|
<input type="hidden" name="email_verified" value="0">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="checkbox" class="form-check-input" id="email_verified_checkbox" name="email_verified" value="1" checked>
|
<input type="checkbox" class="form-check-input" id="email_verified" name="email_verified" value="1">
|
||||||
<label class="form-check-label" for="email_verified_checkbox">{{ get_phrase('Mark email as verified') }}</label>
|
<label class="form-check-label" for="email_verified">{{ get_phrase('Mark email as verified') }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -22,19 +22,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endisset
|
@endisset
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Get the checkbox and the hidden input
|
|
||||||
const checkbox = document.getElementById('email_verified_checkbox');
|
|
||||||
const hiddenInput = document.getElementById('email_verified_value');
|
|
||||||
|
|
||||||
// Update hidden input value when the checkbox is toggled
|
|
||||||
checkbox.addEventListener('change', function() {
|
|
||||||
if (checkbox.checked) {
|
|
||||||
hiddenInput.value = '1'; // Checked, set value to 1
|
|
||||||
} else {
|
|
||||||
hiddenInput.value = '0'; // Unchecked, set value to 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Facebook') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="facebook" class="form-control ol-form-control" id="title" @isset($student->facebook) value="{{ $student->facebook }}" @else value="{{ old('facebook') }}" @endisset>
|
<input type="text" name="facebook" class="form-control ol-form-control" id="title" @isset($student->facebook) value="{{ $student->facebook }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Twitter') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="twitter" class="form-control ol-form-control" id="title" @isset($student->twitter) value="{{ $student->twitter }}" @else value="{{ old('twitter') }}" @endisset>
|
<input type="text" name="twitter" class="form-control ol-form-control" id="title" @isset($student->twitter) value="{{ $student->twitter }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
<label for="title" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Linkedin') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="linkedin" class="form-control ol-form-control" id="title" @isset($student->linkedin) value="{{ $student->linkedin }}" @else value="{{ old('linkedin') }}" @endisset>
|
<input type="text" name="linkedin" class="form-control ol-form-control" id="title" @isset($student->linkedin) value="{{ $student->linkedin }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
<label for="user-name" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Name') }}<span class="text-danger ms-1">*</span></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($student->name) value="{{ $student->name }}" @else value="{{ old('name') }}" @endisset required>
|
<input type="text" name="name" class="form-control ol-form-control" id="user-name" @isset($student->name) value="{{ $student->name }}" @endisset required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
<label for="short_description" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Biography') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description">@isset($student->about){{ $student->about }}@else{{ old('about') }}@endisset</textarea>
|
<textarea name="about" rows="3" class="form-control ol-form-control" id="short_description">@isset($student->about){{ $student->about }}@endisset</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -17,14 +17,14 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
<label for="user-phone" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Phone') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="number" name="phone" class="form-control ol-form-control" id="user-phone" @isset($student->phone ) value="{{ $student->phone }}" @else value="{{ old('phone') }}" @endisset>
|
<input type="text" name="phone" class="form-control ol-form-control" id="user-phone" @isset($student->phone) value="{{ $student->phone }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
<label for="user-address" class="form-label ol-form-label col-sm-2 col-form-label">{{ get_phrase('Address') }}</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($student->address) value="{{ $student->address }}" @else value="{{ old('address') }}" @endisset>
|
<input type="text" name="address" class="form-control ol-form-control" id="user-address" @isset($student->address) value="{{ $student->address }}" @endisset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
|||||||
@ -295,22 +295,4 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
// Validate category logo file size
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -354,21 +354,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
// Validate category logo file size
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -69,5 +69,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<!------------------- Login Area End ------>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function onLoginSubmit(token) {
|
||||||
|
document.getElementById("login-form").submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.custom-btn').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var role = $(this).attr('id');
|
||||||
|
if (role == 'admin') {
|
||||||
|
$('#email').val('admin@example.com');
|
||||||
|
$('#password').val('12345678');
|
||||||
|
} else if (role == 'student') {
|
||||||
|
$('#email').val('student@example.com');
|
||||||
|
$('#password').val('12345678');
|
||||||
|
} else {
|
||||||
|
$('#email').val('instructor@example.com');
|
||||||
|
$('#password').val('12345678');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#showpassword').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const type = $('#password').attr('type');
|
||||||
|
|
||||||
|
if (type == 'password') {
|
||||||
|
$('#password').attr('type', 'text');
|
||||||
|
} else {
|
||||||
|
$('#password').attr('type', 'password');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
@ -10,37 +10,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
@include('frontend.default.student.left_sidebar')
|
@include('frontend.default.student.left_sidebar')
|
||||||
<div class="col-lg-9">
|
<div class="col-lg-9">
|
||||||
@if($user_details->role === 'instructor')
|
|
||||||
<div class="my-panel message-panel edit_profile mb-4">
|
|
||||||
<h4 class="g-title mb-5">{{ get_phrase('PDDikti Information') }}</h4>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-6 mb-20">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="nidn" class="form-label">{{ get_phrase('NIDN') }}</label>
|
|
||||||
<input type="text" class="form-control" name="nidn" value="{{ $user_details->nidn }}" id="nidn" disabled readonly>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-6 mb-20">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="id_sdm" class="form-label">{{ get_phrase('ID PDDikti') }}</label>
|
|
||||||
<input type="text" class="form-control" name="id_sdm" value="{{ $user_details->id_sdm }}" id="id_sdm" disabled readonly>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-6 mb-20">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="id_sms" class="form-label">{{ get_phrase('Study Program') }}</label>
|
|
||||||
<input type="text" class="form-control" name="id_sms" value="{{ $user_details->id_sms }}" id="id_sms" disabled readonly>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-6 mb-20">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="id_pt" class="form-label">{{ get_phrase('University') }}</label>
|
|
||||||
<input type="text" class="form-control" name="id_pt" value="{{ $user_details->id_pt }}" id="id_pt" disabled readonly>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="my-panel message-panel edit_profile mb-4">
|
<div class="my-panel message-panel edit_profile mb-4">
|
||||||
<h4 class="g-title mb-5">{{ get_phrase('Personal Information') }}</h4>
|
<h4 class="g-title mb-5">{{ get_phrase('Personal Information') }}</h4>
|
||||||
@ -55,7 +24,7 @@
|
|||||||
<div class="col-lg-6 mb-20">
|
<div class="col-lg-6 mb-20">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="email" class="form-label">{{ get_phrase('Email Address') }}</label>
|
<label for="email" class="form-label">{{ get_phrase('Email Address') }}</label>
|
||||||
<input type="email" class="form-control" name="email" value="{{ $user_details->email }}" id="email" disabled readonly>
|
<input type="email" class="form-control" name="email" value="{{ $user_details->email }}" id="email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 mb-20">
|
<div class="col-lg-6 mb-20">
|
||||||
|
|||||||
@ -133,33 +133,4 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -184,46 +184,4 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('banner').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
document.getElementById('og_image').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -172,20 +172,4 @@
|
|||||||
});
|
});
|
||||||
//End progress
|
//End progress
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -39,20 +39,4 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -204,19 +204,5 @@
|
|||||||
$('#number_of_month').slideDown();
|
$('#number_of_month').slideDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -18,20 +18,3 @@
|
|||||||
<input type="file" name="preview" class="form-control ol-form-control" id="preview" accept="video/*" />
|
<input type="file" name="preview" class="form-control ol-form-control" id="preview" accept="video/*" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -43,20 +43,3 @@
|
|||||||
<small class="text-muted">{{ get_phrase('Supported Video file') }}: <b>.{{ get_phrase('mp4') }}</b> {{ get_phrase('or') }} <b>.{{ get_phrase('webm') }}</b> {{ get_phrase('or') }} <b>.{{ get_phrase('ogg') }}</b></small>
|
<small class="text-muted">{{ get_phrase('Supported Video file') }}: <b>.{{ get_phrase('mp4') }}</b> {{ get_phrase('or') }} <b>.{{ get_phrase('webm') }}</b> {{ get_phrase('or') }} <b>.{{ get_phrase('ogg') }}</b></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -33,19 +33,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
initializeDurationPickers([".duration_picker"]);
|
initializeDurationPickers([".duration_picker"]);
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -33,20 +33,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
initializeDurationPickers([".duration_picker"]);
|
initializeDurationPickers([".duration_picker"]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<div class="fpb7 mb-2">
|
<div class="fpb7 mb-2">
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('Email') }}</label>
|
<label class="form-label ol-form-label">{{ get_phrase('Email') }}</label>
|
||||||
<input type="email" class="form-control ol-form-control" name="email" value="{{ $auth->email }}" disabled readonly />
|
<input type="email" class="form-control ol-form-control" name="email" value="{{ $auth->email }}" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fpb7 mb-2">
|
<div class="fpb7 mb-2">
|
||||||
@ -70,6 +70,7 @@
|
|||||||
<textarea rows="5" class="form-control ol-form-control text_editor" name="biography" placeholder="">{!! removeScripts($auth->biography) !!}</textarea>
|
<textarea rows="5" class="form-control ol-form-control text_editor" name="biography" placeholder="">{!! removeScripts($auth->biography) !!}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="fpb7 mb-2">
|
<div class="fpb7 mb-2">
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('Photo') }}
|
<label class="form-label ol-form-label">{{ get_phrase('Photo') }}
|
||||||
<small>({{ get_phrase('The image size should be any square image') }})</small>
|
<small>({{ get_phrase('The image size should be any square image') }})</small>
|
||||||
@ -89,31 +90,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div> <!-- end card body-->
|
||||||
</div>
|
</div> <!-- end card -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-5">
|
<div class="col-xl-5">
|
||||||
<div class="ol-card p-4 mb-4">
|
|
||||||
<div class="ol-card-body">
|
|
||||||
<input type="hidden" name="type" value="general">
|
|
||||||
<div class="fpb7 mb-2">
|
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('NIDN') }}</label>
|
|
||||||
<input type="text" class="form-control ol-form-control" name="nidn" value="{{ $auth->nidn }}" disabled readonly />
|
|
||||||
</div>
|
|
||||||
<div class="fpb7 mb-2">
|
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('ID PDDikti') }}</label>
|
|
||||||
<input type="text" class="form-control ol-form-control" name="id_sdm" value="{{ $auth->id_sdm }}" disabled readonly />
|
|
||||||
</div>
|
|
||||||
<div class="fpb7 mb-2">
|
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('Study Program') }}</label>
|
|
||||||
<input type="text" class="form-control ol-form-control" name="id_sms" value="{{ $auth->id_sms }}" disabled readonly />
|
|
||||||
</div>
|
|
||||||
<div class="fpb7 mb-2">
|
|
||||||
<label class="form-label ol-form-label">{{ get_phrase('University') }}</label>
|
|
||||||
<input type="text" class="form-control ol-form-control" name="id_pt" value="{{ $auth->id_pt }}" disabled readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ol-card p-4">
|
<div class="ol-card p-4">
|
||||||
<div class="ol-card-body">
|
<div class="ol-card-body">
|
||||||
<form action="{{ route('instructor.manage.profile.update') }}" method="post"> @csrf
|
<form action="{{ route('instructor.manage.profile.update') }}" method="post"> @csrf
|
||||||
|
|||||||
@ -249,20 +249,4 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -298,21 +298,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@ -55,21 +55,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@include('instructor.init')
|
@include('instructor.init')
|
||||||
|
|||||||
@ -55,21 +55,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
document.getElementById('thumbnail').addEventListener('change', function(event) {
|
|
||||||
const file = event.target.files[0]; // Get the selected file
|
|
||||||
const maxSize = 2 * 1024 * 1024; // 2 MB in bytes
|
|
||||||
|
|
||||||
// Get the message from Laravel's get_phrase function
|
|
||||||
const maxFileSizeMessage = '{{ get_phrase('The maximum file size is 2 MB.') }}';
|
|
||||||
|
|
||||||
if (file && file.size > maxSize) {
|
|
||||||
// If the file is larger than 2 MB, show an alert and reset the input
|
|
||||||
alert(maxFileSizeMessage); // Use the translated message
|
|
||||||
event.target.value = ''; // Clear the selected file
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@include('instructor.init')
|
@include('instructor.init')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user