瀏覽代碼

All Section Modified

Mostafijur Rahman 1 年之前
父節點
當前提交
96cf2560f2

+ 2 - 0
app/Http/Controllers/AjaxController.php

@@ -450,6 +450,7 @@ class AjaxController extends Controller
                     $student_proposal =new StudentProposal;
                     $student_proposal->student_id =$user->id;
                     $student_proposal->teacher_id =$req->id;
+                    $student_proposal->draft_status =1;
                     $student_proposal->save();
 
                     $refer =new ReferUser;
@@ -474,6 +475,7 @@ class AjaxController extends Controller
                 $student_proposal =new StudentProposal;
                 $student_proposal->student_id =$user->id;
                 $student_proposal->teacher_id =$req->id;
+                $student_proposal->draft_status =1;
                 $student_proposal->save();
 
                 $refer =new ReferUser;

+ 17 - 2
app/Http/Controllers/ModalController.php

@@ -215,6 +215,7 @@ class ModalController extends Controller{
             $student_proposal->proposal_submit_status = 1;
             $student_proposal->submitted_date = now();
             $student_proposal->created_by =$req->student_id;
+            $student_proposal->draft_status =0; // Q-Form
             $student_proposal->update();
 
             $student_data =User::find($student_proposal->student_id);
@@ -286,6 +287,20 @@ class ModalController extends Controller{
 
                 $user_notify =User::where('email',$req->email)->where('user_type',1)->first();
 
+                // $isUserExists = User::where(
+                //     'email',$req->email
+                // )->where(
+                //     'user_type',2
+                // )->where(function($q){
+                //     $q->where('sign_up',1)->orWhere('sign_up',0);
+                // })->exists();
+    
+                // if($isUserExists){
+                //     return response([
+                //         'msg'=>'Already there is an account associated this email ID. Please login to your account.'
+                //     ],403);
+                // }
+
                 $is_student_proposal_exists =StudentProposal::where(
                     'teacher_id',$teacher->id
                 )->where(
@@ -296,7 +311,7 @@ class ModalController extends Controller{
 
                 if($is_student_proposal_exists){
                     return response(
-                        ['msg'=>'Already pending a proposal'],403
+                        ['msg'=>'Already pending your proposal. Please  wait for approving.'],403
                     );
                 }else{
                     $refer =new ReferUser;
@@ -488,7 +503,7 @@ class ModalController extends Controller{
 
             if($isUserExists){
                 return response([
-                    'msg'=>'Already there is an account associated this email ID.'
+                    'msg'=>'Already there is an account associated this email ID. Please login to your account.'
                 ],403);
 
             }else{

+ 8 - 4
resources/views/admin/admin_profile.blade.php

@@ -701,6 +701,8 @@ tbody, td, tfoot, th, thead, tr {
                                                                                                     'student_id',$row->id
                                                                                                 )->where(
                                                                                                     'proposal_submit_status',0
+                                                                                                )->where(
+                                                                                                    'draft_status',1
                                                                                                 )->count();
 
                                                                                                $total_submitted =\DB::table(
@@ -709,11 +711,13 @@ tbody, td, tfoot, th, thead, tr {
                                                                                                     'student_id',$row->id
                                                                                                 )->where(
                                                                                                     'proposal_submit_status',1
+                                                                                                )->where(
+                                                                                                    'draft_status',0
                                                                                                 )->count();
                                                                                             @endphp
                                                                                             <div> 
                                                                                                 <span class="label_badge_radius" style="background-color: #ffbd5978; color: #ff9a00;">
-                                                                                                    @if($total_draft > 1)
+                                                                                                    @if($total_draft > 0)
                                                                                                         {{$total_draft}}
                                                                                                     @else
                                                                                                         {{'0'}}
@@ -724,7 +728,7 @@ tbody, td, tfoot, th, thead, tr {
                                                                                             <div class="mt-1">
                                                                                                
                                                                                                     <span class="label_badge_radius" style="background-color: #d8fdd8; color: green;">
-                                                                                                        @if($total_submitted > 1)
+                                                                                                        @if($total_submitted > 0)
                                                                                                             {{$total_submitted}}
                                                                                                         @else
                                                                                                             {{'0'}}
@@ -776,7 +780,7 @@ tbody, td, tfoot, th, thead, tr {
                                                                                         <td style="font-size: 11px;">{{$key+1}}</td>
                                                                                         <td style="font-size: 11px;">{{$row->first_name}} {{$row->last_name}}</td>
                                                                                         <td style="font-size: 11px;">{{$row->email}}</td>
-                                                                                        <td style="font-size: 11px;">{{date('y M', strtotime($row->invitation_date))}}</td>
+                                                                                        <td style="font-size: 11px;">@if(!empty($row->invitation_date)){{date('y M', strtotime($row->invitation_date))}} @else @endif</td>
                                                                                         <td style="font-size: 11px;">
                                                                                             @php
                                                                                                $reffered_by  =\DB::table('users')->find($row->created_by);
@@ -790,7 +794,7 @@ tbody, td, tfoot, th, thead, tr {
                                                                                                 <span class="label_badge_radius" style="background-color: #d8fdd8; color: green;">Yes</span><br>
                                                                                                 <span>{{date('y M', strtotime($row->registered_date))}}</span>
                                                                                             @else
-                                                                                            <span class="label_badge_radius" style="background-color: #d8fdd8; color: rgb(230, 13, 13);">No</span><br>
+                                                                                            <span class="label_badge_radius" style="background-color: #d8fdd8; color: rgb(230, 13, 13);">--</span><br>
                                                                                             @endif
 
                                                                                         </td>

+ 1 - 1
resources/views/admin/sub_contents/document_required_load.blade.php

@@ -248,7 +248,7 @@
                 </div>
                 <div class="right" style="display: flex; align-self: center;">
                     <span class="main_title" style="font-size: 15px;">Document or Information Required</span> 
-                    <span class="badge badge-success ml-2" style="background: #ffffff; font-weight: 700; font-size: 12px !important; border-radius: 10px; padding: 4px 12px !important; border: 1px solid #d4d2df; color: #2e1153; position: relative; margin-left:5px;">{{$requirements->count()}}</span> 
+                    {{-- <span class="badge badge-success ml-2" style="background: #ffffff; font-weight: 700; font-size: 12px !important; border-radius: 10px; padding: 4px 12px !important; border: 1px solid #d4d2df; color: #2e1153; position: relative; margin-left:5px;">{{$requirements->count()}}</span>  --}}
                 </div>
                 </div>
             </div>

+ 3 - 1
resources/views/teacher/student_proposal_details.blade.php

@@ -923,7 +923,9 @@ element.style {
                                             </div>
                                             <div class="mt-1 p-3 method-box ms-3" style="width: 65%; border: 1px solid #eee; background-color: white;"> 
                                                 <h6 class="method mb-2"> 
-                                                     Apply Ref: {{cn($proposal_details,'teacher_details.ref_no','')}}
+                                                     Apply Ref: {{$proposal_details->student_apply_ref ?? "N/A"}}
+                                                     
+                                                     {{-- {{cn($proposal_details,'teacher_details.ref_no','')}} --}}
                                                 </h6>
                                                 <span>
                                                     <strong style="font-size: 14px;">

+ 4 - 1
sql/update.sql

@@ -217,4 +217,7 @@ ALTER TABLE `users`
 ALTER TABLE `student_proposals`
 	CHANGE COLUMN `concept` `concept` TINYINT(4) NULL DEFAULT '1' COMMENT '1=Good; 2=Averagre; 3=Poor' AFTER `proposal_quality`;
 ALTER TABLE `student_proposals`
-	CHANGE COLUMN `proposal_status` `proposal_status` TINYINT(4) NULL DEFAULT '1' COMMENT '1=New,2=Reviewing,3=Pause, 4=Hold, , 5=Interested ,6=Rejected' AFTER `concept`;
+	CHANGE COLUMN `proposal_status` `proposal_status` TINYINT(4) NULL DEFAULT '1' COMMENT '1=New,2=Reviewing,3=Pause, 4=Hold, , 5=Interested ,6=Rejected' AFTER `concept`;
+
+ALTER TABLE `student_proposals`
+	ADD COLUMN `draft_status` TINYINT(4) NULL DEFAULT '0' COMMENT '1=drafy_q_from' AFTER `submitted_date`;