Browse Source

Merge branch 'master' of https://revinr.site/mostafij-revinr/student-admission

Israat Zarin 1 year ago
parent
commit
25bfecc6f2

+ 95 - 93
app/Http/Controllers/AjaxController.php

@@ -3,7 +3,7 @@
 namespace App\Http\Controllers;
 
 use Illuminate\Http\Request;
-use \App\Helpers\PageSL; 
+use \App\Helpers\PageSL;
 use App\User;
 use App\Models\MarketCountry;
 use App\Models\University;
@@ -14,21 +14,21 @@ use App\StudentProposal;
 use Session;
 use Mail;
 use Auth;
- 
+
 
 class AjaxController extends Controller
 {
     public function get($name, Request $req)
-	{ 
-		if ($name == 'test') { 
-			 
+	{
+		if ($name == 'test') {
+
 		}
 	}
 
 	public function post($name, Request $req)
 	{
-       
-		if($name =='teacher_change_password') {  
+
+		if($name =='teacher_change_password') {
 
 			$validator=\Validator::make($req->all(), [
                 'old_password'=>'required',
@@ -37,9 +37,9 @@ class AjaxController extends Controller
                     'required',
                     'confirmed',
                     'min:8',
-                    //'regex:/[a-z]/',      
-                    //'regex:/[A-Z]/',      
-                    //'regex:/[0-9]/',      
+                    //'regex:/[a-z]/',
+                    //'regex:/[A-Z]/',
+                    //'regex:/[0-9]/',
                     //'regex:/[@$!%*#?&]/',
                 ]
             ]);
@@ -52,10 +52,10 @@ class AjaxController extends Controller
                 return response(['msg'=>$errors[0]], 422);
             }
 
-            $user=auth_user('teacher'); 
+            $user=auth_user('teacher');
 
             if(\Illuminate\Support\Facades\Hash::check($req->old_password, $user->password)) {
-                
+
                 $user->password=bcrypt($req->new_password);
                 $user->update();
 
@@ -68,23 +68,23 @@ class AjaxController extends Controller
                     403
                 );
 
-            } 
+            }
 
 		}elseif($name=="teacher_user_status_change"){
-            $user=auth_user('teacher'); 
+            $user=auth_user('teacher');
             $teacher =User::find($req->id);
             $teacher->status =$req->status;
             $teacher->update();
 
-            $data['name'] = $teacher->first_name.' '.$teacher->last_name;  
+            $data['name'] = $teacher->first_name.' '.$teacher->last_name;
             $user_mail = $teacher->email;
-            $from = 'test@mail.com'; 
+            $from = 'test@mail.com';
             if($teacher->status==1){
                 Mail::send('email.approve_teacher_email',$data, function ($message) use ($user_mail,$from) {
                     $message->from($from);
                     $message->to($user_mail)->subject('New Email Send to you');
                 });
-            } 
+            }
             return response(
                 ['msg'=>'Your login permission successfully updated.']
             );
@@ -92,7 +92,7 @@ class AjaxController extends Controller
         }elseif($name=="set_country"){
             $user =Auth::guard('admin')->user();
             if($req->checked == 'true'){
-                $mc = new MarketCountry; 
+                $mc = new MarketCountry;
                 $mc->country_id = $req->id;
                 $mc->status = 1;
                 $mc->added_by = $user->id;
@@ -102,18 +102,18 @@ class AjaxController extends Controller
                 );
             }else{
                 MarketCountry::where('country_id', $req->id)->delete();
-                
+
                 return response(
                     ['msg'=>'Removed Successfully.']
                 );
-            }  
+            }
         }elseif($name=="add_country_wise_uni"){
             $user =Auth::guard('admin')->user();
             $validator=\Validator::make($req->all(), [
                 'country_id'=>'required',
-                'university_name'=>'required',  
-                'university_website'=>'required',  
-            ]); 
+                'university_name'=>'required',
+                'university_website'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
@@ -128,60 +128,60 @@ class AjaxController extends Controller
 
             return response(
                 ['msg'=>'Saved Successfully.']
-            ); 
-             
-          
+            );
+
+
         }elseif($name=="add_department"){
-            $user =Auth::guard('admin')->user(); 
+            $user =Auth::guard('admin')->user();
 
             $validator=\Validator::make($req->all(), [
-                'dapartment'=>'required', 
-            ]); 
+                'dapartment'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
             }
 
-            $data =new Department; 
-            $data->name =$req->dapartment; 
-            $data->status =1; 
+            $data =new Department;
+            $data->name =$req->dapartment;
+            $data->status =1;
             $data->save();
 
             return response(
                 ['msg'=>'Department saved successfully.']
-            ); 
-             
+            );
+
         }elseif($name=="update_profile"){
-             
+
             $validator=\Validator::make($req->all(), [
-                'first_name'=>'required', 
-                'last_name'=>'required', 
-                'university_name'=>'required', 
-                'department'=>'required', 
-            ]); 
+                'first_name'=>'required',
+                'last_name'=>'required',
+                'university_name'=>'required',
+                'department'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
             }
 
-            $data = User::find($req->id); 
-            $data->first_name =$req->first_name; 
-            $data->last_name =$req->last_name; 
-            $data->university_name =$req->university_name; 
-            $data->department =$req->department;  
+            $data = User::find($req->id);
+            $data->first_name =$req->first_name;
+            $data->last_name =$req->last_name;
+            $data->university_name =$req->university_name;
+            $data->department =$req->department;
             $data->update();
 
             return response(
                 ['msg'=>'Saved successfully.']
-            ); 
+            );
         }elseif($name=="add_refer_user"){
-            $user =Auth::user();  
+            $user =Auth::user();
             $validator=\Validator::make($req->all(), [
-                'name'=>'required', 
-                'email'=>'required|email|max:255|unique:refer_users' 
-            ]); 
+                'name'=>'required',
+                'email'=>'required|email|max:255|unique:refer_users'
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
@@ -189,49 +189,51 @@ class AjaxController extends Controller
             }
 
             $std_proposal =StudentProposal::where('student_id',$user->id)->first();
-            
+
             if(empty($std_proposal)){
                 return response(
                     ['msg'=>'Sorry! you have to submit a proposal first.'],403
                 );
             }
 
-            $refer =new ReferUser; 
-            $refer->name =$req->name; 
-            $refer->email =$req->email;  
-            $refer->refer_by =$user->id;  
-            $refer->teacher_id =$std_proposal->teacher_id;  
+            $refer =new ReferUser;
+            $refer->name =$req->name;
+            $refer->email =$req->email;
+            $refer->refer_by =$user->id;
+            $refer->teacher_id =$std_proposal->teacher_id;
             $refer->save();
 
             if($refer->save()){
-                $data['name'] = $refer->name;  
-                $data['applicant_name'] = $user->first_name.' '.$user->last_name;  
+                $data['name'] = $refer->name;
+                $data['teacher_id'] = $refer->teacher_id;
+                $data['std_email'] = $refer->email;
+                $data['applicant_name'] = $user->first_name.' '.$user->last_name;
                 $user_mail = $refer->email;
-                $from = 'test@mail.com'; 
-            
+                $from = 'test@mail.com';
+
                 Mail::send('email.refer_email',$data, function ($message) use ($user_mail,$from) {
                     $message->from($from);
                     $message->to($user_mail)->subject('New Email Send to you');
                 });
-            } 
+            }
 
             return response(
                 ['msg'=>'Refer saved successfully.']
-            ); 
+            );
         }elseif($name=="research_interest"){
 
             $validator=\Validator::make($req->all(), [
-                'research'=>'required', 
-            ]); 
+                'research'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
             }
 
-            $data = new ResearchInterest; 
-            $data->teacher_id =$req->id; 
-            $data->research =$req->research; 
+            $data = new ResearchInterest;
+            $data->teacher_id =$req->id;
+            $data->research =$req->research;
             $data->save();
 
             return response(
@@ -240,16 +242,16 @@ class AjaxController extends Controller
         }elseif($name=="edit_university_save"){
             $user=Auth::guard('admin')->user();
             $validator=\Validator::make($req->all(), [
-                'country_id'=>'required', 
-                'university_name'=>'required', 
-                'university_website'=>'required', 
-            ]); 
+                'country_id'=>'required',
+                'university_name'=>'required',
+                'university_website'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
-            } 
-            
+            }
+
 			$data =University::find($req->edit_id);
             $data->country_id =$req->country_id;
             $data->name =$req->university_name;
@@ -261,25 +263,25 @@ class AjaxController extends Controller
             ]);
 
         }elseif($name=="delete_university_info"){
-            $user=Auth::guard('admin')->user(); 
+            $user=Auth::guard('admin')->user();
             $data =University::find($req->delete_id);
             $data->delete();
             return response([
                 'msg'=>'Successfully Deleted'
             ]);
-        
+
         }elseif($name=="delete_department_info"){
-            $user=Auth::guard('admin')->user(); 
+            $user=Auth::guard('admin')->user();
             $data =Department::find($req->delete_id);
             $data->delete();
             return response([
                 'msg'=>'Successfully Deleted'
             ]);
         }elseif($name=="edit_department_save"){
-            $user=Auth::guard('admin')->user(); 
+            $user=Auth::guard('admin')->user();
             $validator=\Validator::make($req->all(), [
-                'department'=>'required', 
-            ]); 
+                'department'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
@@ -287,7 +289,7 @@ class AjaxController extends Controller
             }
 
             $data =Department::find($req->edit_id);
-            $data->name =$req->department; 
+            $data->name =$req->department;
             $data->update();
             return response([
                 'msg'=>'Successfully updated.'
@@ -301,13 +303,13 @@ class AjaxController extends Controller
             return response(
                 ['msg'=>'Updated successfully.']
             );
-         
+
         }elseif($name=="proposal_status_update"){
 
             $data =StudentProposal::find($req->id);
-            $data->proposal_status =$req->value;  
-            $data->proposal_status_date =now(); 
-            $data->feedback_msg =NULL; 
+            $data->proposal_status =$req->value;
+            $data->proposal_status_date =now();
+            $data->feedback_msg =NULL;
 
             $data->update();
 
@@ -317,26 +319,26 @@ class AjaxController extends Controller
 
         }elseif($name=="proposal_feedback_update"){
             $validator=\Validator::make($req->all(), [
-                'message'=>'required',  
-            ]); 
+                'message'=>'required',
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
             }
-            
+
             $data =StudentProposal::find($req->id);
             $data->proposal_status =$req->proposal_status;
-            $data->feedback_msg =$req->message; 
-            $data->proposal_status_date =now(); 
+            $data->feedback_msg =$req->message;
+            $data->proposal_status_date =now();
             $data->update();
 
             return response(
                 ['msg'=>'Updated successfully.']
             );
-            
+
         }elseif($name=="accept_status_update"){
-            $data =StudentProposal::find($req->id); 
+            $data =StudentProposal::find($req->id);
             $data->accepted_status =1;
             $data->accepted_date =now();
             $data->update();
@@ -346,12 +348,12 @@ class AjaxController extends Controller
             ]);
         }elseif($name=="proposal_quality_rate_star_update"){
             $data =StudentProposal::find($req->id);
-            $data->proposal_quality =$req->value; 
+            $data->proposal_quality =$req->value;
             $data->update();
 
             return response([
                 'msg'=>'Updated successfully.'
             ]);
-        }  
+        }
 	}
 }

+ 7 - 11
app/Http/Controllers/HomeController.php

@@ -3,13 +3,6 @@
 namespace App\Http\Controllers;
 
 use Illuminate\Http\Request;
-use App\Institution;
-use App\Workexperience;
-use App\Score;
-use App\User;
-use App\Proposal;
-use App\AcademicLevel;
-use App\StudentProposalUpload; 
 use Auth;
 class HomeController extends Controller
 {
@@ -20,7 +13,7 @@ class HomeController extends Controller
      */
     public function __construct()
     {
-        $this->middleware('auth');
+       // $this->middleware('auth');
     }
 
     /**
@@ -28,8 +21,11 @@ class HomeController extends Controller
      *
      * @return \Illuminate\Contracts\Support\Renderable
      */
-    public function index()
-    { 
-       
+    public function student_registration_Qform($hash)
+    {
+        $hashids=new \Hashids\Hashids('student_signup', 25);
+        $hash_teacher_ids=$hashids->decode($hash);
+        if(empty($hash_teacher_ids[0])) abort(404);
+        return view('Q_apply_form',compact('hash_teacher_ids'));
     }
 }

+ 35 - 33
app/Http/Controllers/ModalController.php

@@ -3,7 +3,7 @@
 namespace App\Http\Controllers;
 
 use Illuminate\Http\Request;
-use App\Http\Controllers\Controller; 
+use App\Http\Controllers\Controller;
 use App\Proposal;
 use App\User;
 use App\StudentProposal;
@@ -26,18 +26,18 @@ class ModalController extends Controller{
         ];
 
         if($name=="apply_student_proposal"){
-            $data['teacher'] = User::find($req->id); 
-            $data['student'] = User::find($user->id); 
-            $data['proposal']= Proposal::where('student_id',$user->id)->get(); 
+            $data['teacher'] = User::find($req->id);
+            $data['student'] = User::find($user->id);
+            $data['proposal']= Proposal::where('student_id',$user->id)->get();
         }elseif($name=="view_apply_proposal"){
-            $data['std_proposal'] =StudentProposal::find($req->id); 
+            $data['std_proposal'] =StudentProposal::find($req->id);
 
         }elseif($name=="view_student_proposal"){
             $data['proposal']= Proposal::where(
                     'student_id',$user->id
                 )->where(
                     'id',$req->id
-                )->first(); 
+                )->first();
 
         }elseif($name=="add_destination"){
 
@@ -61,21 +61,21 @@ class ModalController extends Controller{
                 'proposal_id'=>'required',
                 'startdate'=>'required',
                 'startmonth'=>'required',
-                
+
             ]);
 
             if($validator->fails()){
 
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
-            } 
+            }
 
             $already_exists = StudentProposal::where('student_id',$req->student_id)->exists();
             if($already_exists){
                 return response(['msg'=>'Sorry! You already submitted. You can not submit proposal.'],403);
             }
 
-            $student_proposal =new StudentProposal; 
+            $student_proposal =new StudentProposal;
             $student_proposal->student_id =$req->student_id;
             $student_proposal->teacher_id =$req->teacher_id;
             $student_proposal->proposal_id =$req->proposal_id;
@@ -83,17 +83,17 @@ class ModalController extends Controller{
             $student_proposal->start_month =$req->startmonth;
             $student_proposal->created_by =$user->id;
             $student_proposal->student_apply_ref =studentRefNoGenerate();
-            $student_proposal->save(); 
+            $student_proposal->save();
 
             $user =User::find($student_proposal->student_id);
             $proposal_user =User::find($student_proposal->teacher_id);
-            
+
 			 if($user){
-				$data['name'] = $user->first_name.' '.$user->last_name;  
-				$data['teacher'] = $proposal_user->first_name.' '.$proposal_user->last_name;  
-				$data['arn'] = $proposal_user->ref_no;  
+				$data['name'] = $user->first_name.' '.$user->last_name;
+				$data['teacher'] = $proposal_user->first_name.' '.$proposal_user->last_name;
+				$data['arn'] = $proposal_user->ref_no;
 				$user_mail =$user->email;
-				$from = 'test@mail.com'; 
+				$from = 'test@mail.com';
 				Mail::send('email.student_proposal_email',$data, function ($message) use ($user_mail,$from) {
 					$message->from($from);
 					$message->to($user_mail)->subject('New Email Send to you');
@@ -107,51 +107,53 @@ class ModalController extends Controller{
                 )->first();
 
              if($proposal_user){
-                $data['name'] = $proposal_user->first_name.' '.$proposal_user->last_name;  
-                $data['std_name'] = $user->first_name.' '.$user->last_name; 
-                $data['proposal_title'] =$proposal->title; 
+                $data['name'] = $proposal_user->first_name.' '.$proposal_user->last_name;
+                $data['std_name'] = $user->first_name.' '.$user->last_name;
+                $data['proposal_title'] =$proposal->title;
                 $data['date_time']=$student_proposal->created_at;
 				$user_mail =$proposal_user->email;
-				$from = 'test@mail.com'; 
+				$from = 'test@mail.com';
 				Mail::send('email.teacher_proposal_email',$data, function ($message) use ($user_mail,$from) {
 					$message->from($from);
 					$message->to($user_mail)->subject('New Email Send to you');
 				});
              }
 
-           
+
             return response(['msg'=>'Proposal send successfully.']);
 
         }elseif($name=="add_wishlist"){
             $user =Auth::guard('teacher')->user();
             $validator=\Validator::make($req->all(), [
-                'name'=>'required', 
-                'email'=>'required|email|max:255|unique:refer_users' 
-            ]); 
+                'name'=>'required',
+                'email'=>'required|email|max:255|unique:refer_users'
+            ]);
 
             if($validator->fails()){
                 $errors=$validator->errors()->all();
                 return response(['msg'=>$errors[0]], 422);
             }
 
-            $refer =new ReferUser; 
-            $refer->name =$req->name; 
-            $refer->email =$req->email;  
-            $refer->refer_by =$user->id;  
-            $refer->teacher_id =$user->id;  
+            $refer =new ReferUser;
+            $refer->name =$req->name;
+            $refer->email =$req->email;
+            $refer->refer_by =$user->id;
+            $refer->teacher_id =$user->id;
             $refer->save();
 
             if($refer->save()){
-                $data['name'] = $refer->name;  
-                $data['applicant_name'] = $user->first_name.' '.$user->last_name;  
+                $data['name'] = $refer->name;
+                $data['teacher_id'] = $refer->teacher_id;
+                $data['std_email'] = $refer->email;
+                $data['applicant_name'] = $user->first_name.' '.$user->last_name;
                 $user_mail = $refer->email;
-                $from = 'test@mail.com'; 
-            
+                $from = 'test@mail.com';
+
                 Mail::send('email.refer_email',$data, function ($message) use ($user_mail,$from) {
                     $message->from($from);
                     $message->to($user_mail)->subject('New Email Send to you');
                 });
-            } 
+            }
 
             return response(
                 ['msg'=>'Refer saved successfully.']

+ 1 - 0
composer.json

@@ -12,6 +12,7 @@
         "fideloper/proxy": "^4.4",
         "fruitcake/laravel-cors": "^2.0",
         "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
+        "hashids/hashids": "^4.1",
         "laravel/framework": "^7.29",
         "laravel/tinker": "^2.5",
         "laravel/ui": "2.5.0",

+ 71 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "a5c8848983c58963f4396fdf22763e89",
+    "content-hash": "a81266727acdbba506148f12599d6d08",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -1038,6 +1038,76 @@
             ],
             "time": "2023-03-09T13:19:02+00:00"
         },
+        {
+            "name": "hashids/hashids",
+            "version": "4.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/vinkla/hashids.git",
+                "reference": "8cab111f78e0bd9c76953b082919fc9e251761be"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/vinkla/hashids/zipball/8cab111f78e0bd9c76953b082919fc9e251761be",
+                "reference": "8cab111f78e0bd9c76953b082919fc9e251761be",
+                "shasum": ""
+            },
+            "require": {
+                "ext-mbstring": "*",
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^8.0 || ^9.4",
+                "squizlabs/php_codesniffer": "^3.5"
+            },
+            "suggest": {
+                "ext-bcmath": "Required to use BC Math arbitrary precision mathematics (*).",
+                "ext-gmp": "Required to use GNU multiple precision mathematics (*)."
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.1-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Hashids\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ivan Akimov",
+                    "email": "ivan@barreleye.com"
+                },
+                {
+                    "name": "Vincent Klaiber",
+                    "email": "hello@doubledip.se"
+                }
+            ],
+            "description": "Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers",
+            "homepage": "https://hashids.org/php",
+            "keywords": [
+                "bitly",
+                "decode",
+                "encode",
+                "hash",
+                "hashid",
+                "hashids",
+                "ids",
+                "obfuscate",
+                "youtube"
+            ],
+            "support": {
+                "issues": "https://github.com/vinkla/hashids/issues",
+                "source": "https://github.com/vinkla/hashids/tree/4.1.0"
+            },
+            "time": "2020-11-26T19:24:33+00:00"
+        },
         {
             "name": "laravel/framework",
             "version": "v7.30.6",

+ 10 - 9
resources/views/Q-apply.blade.php → resources/views/Q_apply_form.blade.php

@@ -101,8 +101,8 @@
                 color:#ffff;
             }
             .tmail{
-                color: #a7a7a7; 
-                text-align: center; 
+                color: #a7a7a7;
+                text-align: center;
                 margin: 0px;
             }
             .form-control {
@@ -165,15 +165,16 @@
                                                         </div>
                                                         <div class="single_glance_row mt-1">
                                                             <span style="font-size: 14px;">English</span>
-                                                        </div>        
-                                                    </div>    
+                                                        </div>
+                                                    </div>
                                                 <div class="col-lg-12 mt-4">
+                                                    <input type="hidden" name="teacher_id" value="{{ $hash_teacher_ids[0] }}">
                                                     <div class="mb-3">
                                                         <label class="form-label" style="font-size: 21px; font-weight: 200;">Full Name<span style="color: red;">*</span></label>
                                                         <div class="form-icon position-relative">
                                                             <input type="text" class="form-control" id="" placeholder="" name="name" required="">
                                                         </div>
-                                                    </div> 
+                                                    </div>
                                                     <div class="mb-3">
                                                         <label class="form-label" style="font-size: 21px; font-weight: 200;">Email Address<span style="color: red;">*</span></label>
                                                         <div class="form-icon position-relative">
@@ -199,7 +200,7 @@
                                                                 </div>
                                                             </div>
                                                         </div><!--end col-->
-                            
+
                                                         <div class="col-12">
                                                             <div class="d-flex align-items-center">
                                                                 <h2><i data-feather="cpu" class="fea icon-m-md text-primary"></i></h2>
@@ -207,7 +208,7 @@
                                                                     <p class="text-muted mb-0">Earn points for everything you do and use your points whenever you want.</p>
                                                                 </div>
                                                             </div>
-                                                        </div><!--end col--> 
+                                                        </div><!--end col-->
                                                         <div class="col-12">
                                                             <div class="d-flex align-items-center">
                                                                 <h2><i data-feather="cpu" class="fea icon-m-md text-primary"></i></h2>
@@ -232,8 +233,8 @@
                                     </div>
                                 </div><!--end col-->
                             </div><!--end row-->
-                        </div> <!-- end about detail --> 
-                        <div class="col-lg-3"></div>  
+                        </div> <!-- end about detail -->
+                        <div class="col-lg-3"></div>
                 </div><!--end row-->
             </div><!--end container fluid-->
         </section><!--end section-->

+ 7 - 3
resources/views/email/refer_email.blade.php

@@ -67,8 +67,8 @@
             padding:0px;
             }
             .tmail{
-                color: #a7a7a7; 
-                text-align: center; 
+                color: #a7a7a7;
+                text-align: center;
                 margin: 0px;
             }
        </style>
@@ -81,11 +81,15 @@
                             <div class="card rounded border-0 shadow p-5" style="background-color:white;">
                                 <h3 style="text-align: center; font-family:Ubuntu !important; color: #3c4858 !important; font-size: 30px !important;">Research Admission</h3>
                                 <p class="mt-5">Dear {{$name}},</p>
+                                @php
+                                    $hashids = new \Hashids\Hashids('student_signup', 25);
+                                @endphp
                                 <p class="mt-3">I have found the Research Admission Platform incredibly helpful in my own search for a research supervisor. The platform is a free and easy-to-use tool that can help you connect with potential supervisors.</p>
                                 <p class="mt-2"> It allows you to submit your research proposal to multiple supervisors with just a few clicks. You can then track the real-time status of your application and receive a decision quickly. I found this feature particularly useful, as it allowed me to keep track of the progress of my applications without having to constantly follow up with supervisors.</p>
                                 <p class="mt-2"> I think you would find it to be a valuable resource in your own search for a research supervisor. It's free to use and can save you a lot of time and effort in finding the right match for your research interests. If you have any questions about the platform or would like some help getting started, please don't hesitate to reach out to me.</p>
+                                <a href="{{ url('std/'.$hashids->encode($teacher_id)) }}">click here</a>
                                 <p class="mt-2" style="margin: 0px;">Best regards,</p>
-                                <h4>{{$applicant_name}}</h4>
+                                <h4>{{$applicant_name}} {{ $teacher_id }}</h4>
                                     <div style="border-top: 1px solid #eee;">
                                     <p class="mt-3 tmail" style="font-style: italic;">This email was sent to example@gmail.com</p>
                                 </div>

+ 89 - 88
resources/views/teacher_profile.blade.php

@@ -52,7 +52,7 @@
         <link href="{{ asset('css/noty/lib/noty.css') }}" rel="stylesheet" type="text/css">
         <link href="{{ asset('css/noty/lib/themes/sunset.css') }}" rel="stylesheet" type="text/css">
         <link href="{{ asset('css/flatpickr/dist/flatpickr.min.css') }}" rel="stylesheet" type="text/css">
-        <link href="{{ asset('css/wait-me/waitMe.min.css')}}"  rel="stylesheet" type="text/css"> 
+        <link href="{{ asset('css/wait-me/waitMe.min.css')}}"  rel="stylesheet" type="text/css">
     </head>
     <style>
 
@@ -333,10 +333,10 @@ tbody, td, tfoot, th, thead, tr {
                                 <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                     <li class="nav-item dropdown dropdown-notification">
                                         <a href="javascript:void(0)" class="open_modal_page" data-url="{{route('modal-get',['name'=>'add_wishlist'])}}" data-title="Wishlist">
-                                        <button class="btn btn2">New lead</button>    
+                                        <button class="btn btn2">New lead</button>
                                         </a>
                                     </li>
-                                </ul> 
+                                </ul>
                                 <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                     <li class="nav-item dropdown dropdown-notification">
                                         <a href="">
@@ -393,7 +393,7 @@ tbody, td, tfoot, th, thead, tr {
                                             </div>
                                         </a><!--end nav link-->
                                     </li><!--end nav item-->
-                                    
+
                                     <li class="nav-item">
                                         <a class="nav-link" id="application" data-bs-toggle="pill" href="#applicate" role="tab" aria-controls="dental" aria-selected="false">
                                             <div class="text-start py-1 px-2" style="display:flex;">
@@ -449,16 +449,16 @@ tbody, td, tfoot, th, thead, tr {
                 </div><!--end col-->
 
             <div class="col-md-10 col-12 mt-5" style="padding:1rem; padding-top: 2.5rem!important;">
-                <div class="tab-content" id="pills-tabContent"> 
+                <div class="tab-content" id="pills-tabContent">
                     <div class="tab-pane fade show p-2 rounded active" id="dash" role="tabpanel" aria-labelledby="dashboard">
                         <div class="card p-2 rounded border-0" style="background-color: #16183f1c; color: #141639c4;">
                             <div class="col-md-12">
                                 <div class="row p-2">
-                                    <h6 style="font-weight:bold !important;">There are three available methods for doctoral applicants to submit their proposals :</h6>                            
-                                    <p style="font-size: 13px;"><strong>Method 1:</strong> You can give your ARN to the student and request them to submit their proposal using your reference.</p>                            
-                                    <p style="font-size: 13px;"><strong>Method 2:</strong> You can log in to your account, include the student's name and email address in Q Apply, and send them an invitation. This way, their application will be automatically tagged with your reference.</p>                            
-                                    <p style="font-size: 13px; margin-bottom: 0px;"><strong>Method 3:</strong> You can share the Q Apply link with the student and ask them to fill out the form using their name and email. An invitation email will be sent to them, and then they can proceed with method 2.</p>                            
-                                </div>                                                       
+                                    <h6 style="font-weight:bold !important;">There are three available methods for doctoral applicants to submit their proposals :</h6>
+                                    <p style="font-size: 13px;"><strong>Method 1:</strong> You can give your ARN to the student and request them to submit their proposal using your reference.</p>
+                                    <p style="font-size: 13px;"><strong>Method 2:</strong> You can log in to your account, include the student's name and email address in Q Apply, and send them an invitation. This way, their application will be automatically tagged with your reference.</p>
+                                    <p style="font-size: 13px; margin-bottom: 0px;"><strong>Method 3:</strong> You can share the Q Apply link with the student and ask them to fill out the form using their name and email. An invitation email will be sent to them, and then they can proceed with method 2.</p>
+                                </div>
                             </div>
                         </div>
                     </div><!--end teb pane-->
@@ -559,13 +559,13 @@ tbody, td, tfoot, th, thead, tr {
                                                     <span style="color: black;">{{cn($row,'scores.overall_score','')}}</span>
                                                 </div>
                                             </td>
-                                            <td style="font-size: 11px; text-align:center;"> 
-                                                @php 
+                                            <td style="font-size: 11px; text-align:center;">
+                                                @php
 
-                                                    $work_history_first =$row->work_experience_date()->whereNotNull('start_date')->oldest()->first();  
+                                                    $work_history_first =$row->work_experience_date()->whereNotNull('start_date')->oldest()->first();
 
                                                     $work_history_last =$row->work_experience_date()->latest()->first();
-                                                    if($work_history_first && $work_history_last && $work_history_last->end_date){ 
+                                                    if($work_history_first && $work_history_last && $work_history_last->end_date){
 
                                                     $diff_in_days =diff_in_days($work_history_first->start_date,$work_history_last->end_date);
 
@@ -573,23 +573,24 @@ tbody, td, tfoot, th, thead, tr {
                                                     $diff_in_days =diff_in_days($work_history_first->start_date, now());
                                                     }else{
                                                     $diff_in_days =0;
-                                                    } 
+                                                    }
 
                                                     $years = ($diff_in_days / 365) ;
-                                                    $years = floor($years); 
-                                                    $month = ($diff_in_days % 365) / 30.5; 
-                                                    $month = floor($month); 
-                                                    $days = ($diff_in_days % 365) % 30.5; 
+                                                    $years = floor($years);
+                                                    $month = ($diff_in_days % 365) / 30.5;
+                                                    $month = floor($month);
+                                                    $days = ($diff_in_days % 365) % 30.5;
                                                   @endphp
-                                                    
-                                                   
-                                                <div style="font-size: 11px; display:block;"> 
+
+
+                                                <div style="font-size: 11px; display:block;">
                                                     <span class="label_badge_work">{{$years}} years</span>
                                                 </div>
                                                 <div style="font-size: 11px; display:block;">
 
+
                                                     {{-- ({{ dDate($work_history_first->start_date) }} - {{dDate($work_history_last->end_date, 'd M Y', 'Continue')}})  --}}
-                                                     
+
                                                 </div>
                                             </td>
                                             <td style="font-size: 11px;">
@@ -603,7 +604,7 @@ tbody, td, tfoot, th, thead, tr {
                                                 </div>
                                             </td>
                                             <td style="font-size: 11px; text-align:center;">
-                                               
+
                                                 <div class="top_part_status">
                                                     {{-- @if($row->proposal_status ==1)
                                                         <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">In Review</button>
@@ -618,7 +619,7 @@ tbody, td, tfoot, th, thead, tr {
                                                     <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">In Review</button>
                                                     @else
                                                     <button class="btn btn2 accept_status_update" data-id="{{$row->id}}" style="padding: 1px 10px !important; font-size: 11px;">Accept</button>
-                                                    @endif 
+                                                    @endif
                                                 </div>
                                             </td>
                                         </tr>
@@ -678,7 +679,7 @@ tbody, td, tfoot, th, thead, tr {
                         <div class="row">
                             <div class="col-md-8 bg-white rounded p-2 ms-2">
                                     <h6 style="padding: 8px 4px 0px;">Application Summary</h6>
-                                <div class="col-md-12">   
+                                <div class="col-md-12">
                                     <div class="table-responsive">
                                         <table class="table table-bordered list_table">
                                             <thead>
@@ -800,9 +801,9 @@ tbody, td, tfoot, th, thead, tr {
                                                     <span class="label_badge_radius mb-1 ms-2" style="background: #d8fdd8; color: green;">
                                                         Premium
                                                     </span>
-                                                </div>                                       
+                                                </div>
                                             </div>
-                                        </div> 
+                                        </div>
                                     </div>
                                  </div>
                             </div><!--end col-->
@@ -845,8 +846,8 @@ tbody, td, tfoot, th, thead, tr {
                                                                                         <input type="text" class="form-control" placeholder="Last Name" id="last_name" name="last_name" value="{{$user->last_name}}" required="" style="font-size: 13px;">
                                                                                     </div>
                                                                                 </div>
-                                                                            </div> 
-                                                                        </div>  
+                                                                            </div>
+                                                                        </div>
                                                                         <div class="col-md-12">
                                                                             <div class="mb-2">
                                                                                 <label class="form-label config">University Name</label>
@@ -859,10 +860,10 @@ tbody, td, tfoot, th, thead, tr {
                                                                                         @endforeach
 
                                                                                     </select>
-                                                                               
+
                                                                                 </div>
                                                                             </div>
-                                                                        </div> 
+                                                                        </div>
                                                                         <div class="col-md-12">
                                                                             <div class="mb-2">
                                                                                 <label class="form-label config">Department</label>
@@ -876,26 +877,26 @@ tbody, td, tfoot, th, thead, tr {
                                                                                     </select>
                                                                                 </div>
                                                                             </div>
-                                                                        </div> 
+                                                                        </div>
                                                                         <div class="col-md-12">
                                                                             <div class="text-end">
-                                                                                <button class="btn btn2 update_profile">Update</button>                                                                                                                
+                                                                                <button class="btn btn2 update_profile">Update</button>
                                                                             </div>
-                                                                        </div>  
+                                                                        </div>
                                                                 </div>
-                                                            </div> 
-                                                        </div> 
-                                                    </div> 
+                                                            </div>
+                                                        </div>
+                                                    </div>
                                                 <div class="left mb-2 mt-2">
-                                                    <div id="load_profile_info">       
+                                                    <div id="load_profile_info">
                                                     </div>
-                                                </div> 
+                                                </div>
                                             </div>
                                         </div>
-                                    </div><!--end col-->              
+                                    </div><!--end col-->
                                     <div class="col-md-4 bg-white rounded p-2 ms-4" style="width: 32.4%;">
                                         <div class="row">
-                                           
+
                                             <div class="col-md-12">
                                                  <h6 style="padding: 13px 10px 0px;">Change password</h6>
                                                 <div class="form-icon position-relative p-2 mt-2">
@@ -911,7 +912,7 @@ tbody, td, tfoot, th, thead, tr {
                                                         <button class="btn btn2 mt-3 change_password">Changed</button>
                                                     </div>
                                                 </div>
-                                            </div> 
+                                            </div>
                                         </div>
                                     </div><!--end col-->
                                     <div class="col-md-2 bg-white rounded p-2 ms-4" style="width:25%;">
@@ -953,19 +954,19 @@ tbody, td, tfoot, th, thead, tr {
                                                                                         <input type="text" class="form-control" placeholder="Department" name="department" required="" style="font-size: 13px;">
                                                                                     </div>
                                                                                 </div>
-                                                                            </div>     
+                                                                            </div>
                                                                             <div class="col-md-12">
                                                                                 <div class="text-end">
-                                                                                    <button class="btn btn2">Update</button>                                                                                                                
+                                                                                    <button class="btn btn2">Update</button>
                                                                                 </div>
                                                                             </div>
-                                                                        </div> 
+                                                                        </div>
                                                                     </form>
                                                                 </div>
-                                                            </div> 
+                                                            </div>
                                                         </div>  -->
-                                                    </div>                                    
-                                                </div> 
+                                                    </div>
+                                                </div>
                                             </div>
                                         </div>
                                     </div>
@@ -1001,12 +1002,12 @@ tbody, td, tfoot, th, thead, tr {
       {{-- <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> --}}
 
         {{-- Ajax Form Submit --}}
-    
+
         <script src="{{ asset('css/jquery.min.js') }}"></script>
         <script src="{{ asset('css/jquery-form/dist/jquery.form.min.js') }}"></script>
         <script src="{{ asset('css/noty/lib/noty.min.js') }}"></script>
         <script src="{{ asset('css/flatpickr/dist/flatpickr.min.js') }}"></script>
-        <script src="{{ asset('css/wait-me/waitMe.min.js')}}"></script> 
+        <script src="{{ asset('css/wait-me/waitMe.min.js')}}"></script>
 
         @include('web.layouts.modal')
       <script>
@@ -1042,17 +1043,17 @@ tbody, td, tfoot, th, thead, tr {
 
                 selector.waitMe(config);
 
-            }else{ 
+            }else{
 
                 selector.waitMe({
                     effect: 'facebook',
                     //color: '#000',
                     text: 'Please! Wait ...'
-                }); 
-            } 
+                });
+            }
         }
 
-        function pop_up_msg(msg='No message specified', type='success', callback=null){ 
+        function pop_up_msg(msg='No message specified', type='success', callback=null){
             new Noty({
             theme:'sunset',
             text: msg,
@@ -1061,7 +1062,7 @@ tbody, td, tfoot, th, thead, tr {
             callbacks:{
                 afterClose: callback
             }
-            }).show(); 
+            }).show();
         }
 
         function err_msg(err){
@@ -1089,41 +1090,41 @@ tbody, td, tfoot, th, thead, tr {
                 "{{ route('sub-content', ['name'=>'load_research_interest']) }}"
             );
 
-            $('.update_profile').on('click', function(){  
+            $('.update_profile').on('click', function(){
 
-                var id =$('#u_id').val(); 
-                var first_name =$('#first_name').val(); 
-                var last_name =$('#last_name').val(); 
-                var university_name =$('#university_name').val(); 
-                var department =$('#department_id option:selected').val();  
+                var id =$('#u_id').val();
+                var first_name =$('#first_name').val();
+                var last_name =$('#last_name').val();
+                var university_name =$('#university_name').val();
+                var department =$('#department_id option:selected').val();
 
                 var form_data={
-                    _token: "{{ csrf_token() }}", 
-                    id: id, 
-                    first_name: first_name, 
-                    last_name: last_name, 
-                    university_name: university_name, 
-                    department: department, 
+                    _token: "{{ csrf_token() }}",
+                    id: id,
+                    first_name: first_name,
+                    last_name: last_name,
+                    university_name: university_name,
+                    department: department,
                 }
 
-                $.post("{{ route('ajax-post', ['name'=>'update_profile']) }}", form_data, function(res){ 
+                $.post("{{ route('ajax-post', ['name'=>'update_profile']) }}", form_data, function(res){
                     pop_up_msg(res.msg);
 
                     fetch_sub_content(
                         '#load_profile_info',
                         "{{ route('sub-content', ['name'=>'load_profile_info']) }}"
-                    ); 
+                    );
 
                 }).fail(function(err){
 
                     pop_up_msg(err_msg(err), 'error');
 
-                });                                          
+                });
             });
 
             $('.change_password').on('click', function(){
                 var id =$('#user_id').val();
-                var old_password =$('#old_password').val(); 
+                var old_password =$('#old_password').val();
                 var new_password =$('#new_password').val();
                 var new_password_confirmation =$('#new_password_confirmation').val();
 
@@ -1135,27 +1136,27 @@ tbody, td, tfoot, th, thead, tr {
                     new_password_confirmation: new_password_confirmation,
                 }
 
-                $.post("{{ route('ajax-post', ['name'=>'teacher_change_password']) }}", form_data, function(res){ 
+                $.post("{{ route('ajax-post', ['name'=>'teacher_change_password']) }}", form_data, function(res){
                     pop_up_msg(res.msg);
 
                 }).fail(function(err){
 
                     pop_up_msg(err_msg(err), 'error');
 
-                }); 
+                });
             });
 
             $('.research_interest').on('click', function(){
                 var id =$('#res_user_id').val();
-                var research =$('#research').val();  
+                var research =$('#research').val();
 
                 var form_data={
                     _token: "{{ csrf_token() }}",
                     id: id,
-                    research: research, 
+                    research: research,
                 }
 
-                $.post("{{ route('ajax-post', ['name'=>'research_interest']) }}", form_data, function(res){ 
+                $.post("{{ route('ajax-post', ['name'=>'research_interest']) }}", form_data, function(res){
                     pop_up_msg(res.msg);
                     fetch_sub_content(
                         '#load_research_interest',
@@ -1166,18 +1167,18 @@ tbody, td, tfoot, th, thead, tr {
 
                     pop_up_msg(err_msg(err), 'error');
 
-                }); 
+                });
             });
 
 
             $('.accept_status_update').on('click', function(){
                 var self =$(this);
-                var id =self.data('id'); 
+                var id =self.data('id');
 
                 var form_data={
                     _token :"{{csrf_token()}}",
-                    'id':id, 
-                 } 
+                    'id':id,
+                 }
 
                 swal({
                     title: "Are you sure you want to change status?",
@@ -1192,9 +1193,9 @@ tbody, td, tfoot, th, thead, tr {
                     closeOnCancel: true
                 }, function(isConfirm){
 
-                    if(isConfirm){ 
-                        $.post("{{ route('ajax-post', ['name'=>'accept_status_update']) }}", form_data, function(res){ 
-                            pop_up_msg(res.msg); 
+                    if(isConfirm){
+                        $.post("{{ route('ajax-post', ['name'=>'accept_status_update']) }}", form_data, function(res){
+                            pop_up_msg(res.msg);
                             window.location.reload();
 
                         }).fail(function(err){
@@ -1202,10 +1203,10 @@ tbody, td, tfoot, th, thead, tr {
                             pop_up_msg(err_msg(err), 'error');
 
                         });
-                    } 
-                }); 
-            }); 
-        
+                    }
+                });
+            });
+
 
   });
 

+ 12 - 9
routes/web.php

@@ -26,14 +26,14 @@ Route::get('/', function () {
     return view('welcome');
 });
 
- 
+
 Route::get('/dashboard', function () {
     return view('dashboard');
 });
- 
+
 Route::get('/explore', function () {
     return view('explore');
-}); 
+});
 
 Route::get('/Q-apply', function () {
     return view('Q-apply');
@@ -44,13 +44,16 @@ Route::get('/Q-apply', function () {
 
 
 Auth::routes();
- 
+
 Route::get('/email-verification/{id}', [App\Http\Controllers\RegisterController::class,'email_verification'])->name('/email-verification');
- 
+
 Route::get('/login', [App\Http\Controllers\Auth\LoginController::class,'showLoginForm'])->name('login');
 Route::post('/student-login', [App\Http\Controllers\Auth\LoginController::class,'login'])->name('student-login');
 Route::get('register', [App\Http\Controllers\Auth\RegisterController::class,'showRegistrationForm'])->name('register');
 Route::post('student-register', [App\Http\Controllers\Auth\RegisterController::class,'create'])->name('student-register');
+
+Route::get('std/{hash}', [App\Http\Controllers\HomeController::class,'student_registration_Qform']);
+
 Route::group(['middleware' => ['auth']], function() {
 
 Route::get('/home', [App\Http\Controllers\StudentHomeController::class,'index']);
@@ -89,8 +92,8 @@ Route::post('teacher-logout', [App\Http\Controllers\TeacherAuth\LoginController:
 Route::group(['middleware' => ['teacher']], function() {
     Route::get('/teacher_profile', [App\Http\Controllers\TeacherHomeController::class,'teacher_profile'])->name('teacher_profile');
     Route::get('teacher/student-proposal-details/{id}', [App\Http\Controllers\TeacherHomeController::class,'student_proposal_details']);
-   
-    
+
+
 });
 
 
@@ -101,7 +104,7 @@ Route::post('admin-logout', [App\Http\Controllers\AdminAuth\LoginController::cla
 Route::group(['middleware' => ['admin']], function() {
     Route::get('/admin/dashboard', [App\Http\Controllers\Admin\AdminController::class,'dashboard']);
     Route::get('/admin/dashboard/load_country_list/{text}', [App\Http\Controllers\Admin\AdminController::class,'load_country_list']);
-   
+
 
 });
 
@@ -115,7 +118,7 @@ Route::post(
     'modal/{name}',
      'ModalController@post'
      )->name('modal-post');
-     
+
 Route::get(
 	'ajax/{name}',
 	'AjaxController@get'