|
@@ -14,6 +14,10 @@ use App\Models\Requirement;
|
|
use App\Models\Publication;
|
|
use App\Models\Publication;
|
|
use App\StudentProposal;
|
|
use App\StudentProposal;
|
|
use App\Proposal;
|
|
use App\Proposal;
|
|
|
|
+use App\Institution;
|
|
|
|
+use App\Score;
|
|
|
|
+use App\Workexperience;
|
|
|
|
+use Carbon\Carbon;
|
|
use Session;
|
|
use Session;
|
|
use Mail;
|
|
use Mail;
|
|
use Auth;
|
|
use Auth;
|
|
@@ -312,15 +316,19 @@ class AjaxController extends Controller
|
|
['msg'=>'Updated successfully.']
|
|
['msg'=>'Updated successfully.']
|
|
);
|
|
);
|
|
|
|
|
|
- }elseif($name=="proposal_status_update"){
|
|
|
|
-
|
|
|
|
|
|
+ }elseif($name=="proposal_status_update"){
|
|
$data =StudentProposal::find($req->id);
|
|
$data =StudentProposal::find($req->id);
|
|
$data->proposal_status =$req->value;
|
|
$data->proposal_status =$req->value;
|
|
$data->proposal_status_date =now();
|
|
$data->proposal_status_date =now();
|
|
- $data->feedback_msg =NULL;
|
|
|
|
-
|
|
|
|
|
|
+ $data->feedback_msg =NULL;
|
|
$data->update();
|
|
$data->update();
|
|
|
|
|
|
|
|
+ if($req->value){
|
|
|
|
+ $user_data = User::find($data->student_id);
|
|
|
|
+ $user_data->freez_profile =2; // 2 = [In Review,Pause,Interested]
|
|
|
|
+ $user_data->update();
|
|
|
|
+ }
|
|
|
|
+
|
|
return response(
|
|
return response(
|
|
['msg'=>'Updated successfully.']
|
|
['msg'=>'Updated successfully.']
|
|
);
|
|
);
|
|
@@ -333,7 +341,7 @@ class AjaxController extends Controller
|
|
if($validator->fails()){
|
|
if($validator->fails()){
|
|
$errors=$validator->errors()->all();
|
|
$errors=$validator->errors()->all();
|
|
return response(['msg'=>$errors[0]], 422);
|
|
return response(['msg'=>$errors[0]], 422);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
$data =StudentProposal::find($req->id);
|
|
$data =StudentProposal::find($req->id);
|
|
$data->proposal_status =$req->proposal_status;
|
|
$data->proposal_status =$req->proposal_status;
|
|
@@ -341,16 +349,28 @@ class AjaxController extends Controller
|
|
$data->proposal_status_date =now();
|
|
$data->proposal_status_date =now();
|
|
$data->update();
|
|
$data->update();
|
|
|
|
|
|
|
|
+ if($req->proposal_status ==3){ // 3= rejected
|
|
|
|
+ $user_rejected = User::find($data->student_id);
|
|
|
|
+ $user_rejected->freez_profile =0;
|
|
|
|
+ $user_rejected->update();
|
|
|
|
+ }
|
|
|
|
+
|
|
return response(
|
|
return response(
|
|
['msg'=>'Updated successfully.']
|
|
['msg'=>'Updated successfully.']
|
|
);
|
|
);
|
|
|
|
|
|
- }elseif($name=="accept_status_update"){
|
|
|
|
|
|
+ }elseif($name=="accept_status_update"){
|
|
|
|
+
|
|
$data =StudentProposal::find($req->id);
|
|
$data =StudentProposal::find($req->id);
|
|
$data->accepted_status =1;
|
|
$data->accepted_status =1;
|
|
$data->accepted_date =now();
|
|
$data->accepted_date =now();
|
|
$data->update();
|
|
$data->update();
|
|
|
|
|
|
|
|
+ $user_accepted = User::find($data->student_id);
|
|
|
|
+ $user_accepted->freez_profile =0;
|
|
|
|
+ $user_accepted->update();
|
|
|
|
+
|
|
|
|
+
|
|
return response([
|
|
return response([
|
|
'msg'=>'Updated successfully.'
|
|
'msg'=>'Updated successfully.'
|
|
]);
|
|
]);
|
|
@@ -775,6 +795,157 @@ class AjaxController extends Controller
|
|
|
|
|
|
$data->update();
|
|
$data->update();
|
|
|
|
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully saved.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="publication_status_update"){
|
|
|
|
+ $data =User::find($req->uid);
|
|
|
|
+ if($req->value =='yes'){
|
|
|
|
+ $data->is_publication =1; // 1=yes
|
|
|
|
+ }else{
|
|
|
|
+ $data->is_publication =2; // 2=no
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data->update();
|
|
|
|
+
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully saved.'
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ }elseif($name=="education_status_update"){
|
|
|
|
+ $data =User::find($req->uid);
|
|
|
|
+ if($req->value =='yes'){
|
|
|
|
+ $data->is_education =1; // 1=yes
|
|
|
|
+ }else{
|
|
|
|
+ $data->is_education =2; // 2=no
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data->update();
|
|
|
|
+
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully saved.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="update_education_history"){
|
|
|
|
+ $student=Auth::user();
|
|
|
|
+
|
|
|
|
+ $validator=\Validator::make($req->all(), [
|
|
|
|
+ 'academiclevel'=>'required',
|
|
|
|
+ 'subject'=>'required',
|
|
|
|
+ 'institution'=>'required',
|
|
|
|
+ 'passingyear'=>'required',
|
|
|
|
+ 'result'=>'required',
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if($validator->fails()){
|
|
|
|
+ $errors=$validator->errors()->all();
|
|
|
|
+ return response(['msg'=>$errors[0]], 422);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $institution= Institution::find($req->edit_id);
|
|
|
|
+ $institution->student_id= $student->id;
|
|
|
|
+ $institution->academic_level= $req->academiclevel;
|
|
|
|
+ $institution->subject= $req->subject;
|
|
|
|
+ $institution->institution= $req->institution;
|
|
|
|
+ $institution->passing_year= $req->passingyear;
|
|
|
|
+ $institution->result= $req->result;
|
|
|
|
+ $institution->update();
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully updated.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="delete_education_info"){
|
|
|
|
+ $data =Institution::find($req->delete_id);
|
|
|
|
+ $data->delete();
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully deleted.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="update_english_languge_proficiency"){
|
|
|
|
+ $student=Auth::user();
|
|
|
|
+
|
|
|
|
+ $validator=\Validator::make($req->all(), [
|
|
|
|
+ 'testdate'=>'required',
|
|
|
|
+ 'expirationdate'=>'required',
|
|
|
|
+ 'testname'=>'required',
|
|
|
|
+ 'overallscore'=>'required',
|
|
|
|
+ 'listening'=>'required',
|
|
|
|
+ 'speaking'=>'required',
|
|
|
|
+ 'writing'=>'required',
|
|
|
|
+ 'reading'=>'required',
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if($validator->fails()){
|
|
|
|
+ $errors=$validator->errors()->all();
|
|
|
|
+ return response(['msg'=>$errors[0]], 422);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $score= Score::find($req->edit_id);
|
|
|
|
+ $score->student_id= $student->id;
|
|
|
|
+ $score->test_date= Carbon::parse($req->testdate)->format('Y-m-d');
|
|
|
|
+ $score->expiration_date= Carbon::parse($req->expirationdate)->format('Y-m-d');
|
|
|
|
+ $score->test_name= $req->testname;
|
|
|
|
+ $score->overall_score= $req->overallscore;
|
|
|
|
+ $score->listening= $req->listening;
|
|
|
|
+ $score->writing= $req->speaking;
|
|
|
|
+ $score->reading= $req->writing;
|
|
|
|
+ $score->speaking= $req->reading;
|
|
|
|
+ $score->update();
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully updated.'
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ }elseif($name=="delete_score_info"){
|
|
|
|
+ $data =Score::find($req->delete_id);
|
|
|
|
+ $data->delete();
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully deleted.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="update_work_experience"){
|
|
|
|
+ $student=Auth::user();
|
|
|
|
+
|
|
|
|
+ $validator=\Validator::make($req->all(), [
|
|
|
|
+ 'companyname'=>'required',
|
|
|
|
+ 'designation'=>'required',
|
|
|
|
+ 'startdate'=>'required',
|
|
|
|
+ 'enddate'=>'required',
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if($validator->fails()){
|
|
|
|
+ $errors=$validator->errors()->all();
|
|
|
|
+ return response(['msg'=>$errors[0]], 422);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $work_experience= Workexperience::find($req->edit_id);
|
|
|
|
+ $work_experience->student_id= $student->id;
|
|
|
|
+ $work_experience->company_name= $req->companyname;
|
|
|
|
+ $work_experience->designation= $req->designation;
|
|
|
|
+ if($req->currently_working=='on'){
|
|
|
|
+ $work_experience->currently_working=1;
|
|
|
|
+ }else{
|
|
|
|
+ $work_experience->currently_working=0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $work_experience->start_date= date($req->startdate.'-'.$req->startmonth.'-01');
|
|
|
|
+ $work_experience->end_date= date($req->enddate.'-'.$req->endmonth.'-01');
|
|
|
|
+ $work_experience->update();
|
|
|
|
+
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully updated.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="delete_work_experience_info"){
|
|
|
|
+ $data =Workexperience::find($req->delete_id);
|
|
|
|
+ $data->delete();
|
|
|
|
+ return response([
|
|
|
|
+ 'msg'=>'Successfully deleted.'
|
|
|
|
+ ]);
|
|
|
|
+ }elseif($name=="test_score_status_update"){
|
|
|
|
+ $data =User::find($req->uid);
|
|
|
|
+ if($req->value =='yes'){
|
|
|
|
+ $data->is_test_score =1; // 1=yes
|
|
|
|
+ }else{
|
|
|
|
+ $data->is_test_score =2; // 2=no
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data->update();
|
|
|
|
+
|
|
return response([
|
|
return response([
|
|
'msg'=>'Successfully saved.'
|
|
'msg'=>'Successfully saved.'
|
|
]);
|
|
]);
|