Explorar o código

Proposal details

Mostafijur Rahman %!s(int64=2) %!d(string=hai) anos
pai
achega
37ee5eb410

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

@@ -335,6 +335,24 @@ class AjaxController extends Controller
                 ['msg'=>'Updated successfully.']
             );
             
+        }elseif($name=="accept_status_update"){
+            $data =StudentProposal::find($req->id);
+            $data->proposal_status =1;
+            $data->accepted_date =now();
+            $data->proposal_status_date =now();
+            $data->update();
+
+            return response([
+                'msg'=>'Updated successfully.'
+            ]);
+        }elseif($name=="proposal_quality_rate_star_update"){
+            $data =StudentProposal::find($req->id);
+            $data->proposal_quality =$req->value; 
+            $data->update();
+
+            return response([
+                'msg'=>'Updated successfully.'
+            ]);
         }  
 	}
 }

+ 84 - 8
resources/views/teacher/student_proposal_details.blade.php

@@ -733,6 +733,36 @@ element.style {
     color: #343434;
     font-size: 1rem;
 }
+
+.pro_top_rating {
+    border: none;
+    float: left;
+  }
+  .pro_top_rating > label {
+    color: #90A0A3;
+    float: right;
+  }
+  .pro_top_rating > label:before {
+    margin-right: 5px;
+    font-size: .7rem;
+    font-family: FontAwesome;
+    content: "\f005";
+    display: inline-block;
+  }
+  .pro_top_rating > input {
+    display: none;
+  }
+  .pro_top_rating > input:checked ~ label,
+  .pro_top_rating:not(:checked) > label:hover,
+  .pro_top_rating:not(:checked) > label:hover ~ label {
+    color: #F79426;
+  }
+  .pro_top_rating > input:checked + label:hover,
+  .pro_top_rating > input:checked ~ label:hover,
+  .pro_top_rating > label:hover ~ input:checked ~ label,
+  .pro_top_rating > input:checked ~ label:hover ~ label {
+    color: #FECE31;
+  }
 </style>
 <body>
         <header id="" class="defaultscroll sticky">
@@ -935,7 +965,7 @@ element.style {
                                                     <div class="right">
                                                         <div class="top_part_status" style="position: relative; width: fit-content; margin-left: 10px;">
                                                             <span style="font-size: 10px;">
-                                                                4 April 2023
+                                                                {{ date("d M Y", strtotime($proposal_details->accepted_date))}}
                                                             </span>
                                                         </div>
                                                     </div>
@@ -983,12 +1013,17 @@ element.style {
                                         <div>
                                             <div class="single_glance_row mt-1">
                                                 <span class="title" style="font-size:11px; font-weight: 600;">Proposal Quality :</span>
-                                                <span class="tbl2 mb-2" style="float: right;">
-                                                    <i class="fa-solid fa-star"></i>
-                                                    <i class="fa-solid fa-star"></i>
-                                                    <i class="fa-solid fa-star"></i>
-                                                    <i class="fa-regular fa-star-half-stroke"></i>
-                                                    <i class="fa-regular fa-star"></i>
+                                                <span class="tbl2 mb-2 pro_top_rating" style="float:right;">
+                                                    <input type="radio" class="rate_star_update" data-id="{{$proposal_details->id}}" id="star5" name="rate" value="5" @if($proposal_details->proposal_quality ==5) checked @endif/>
+                                                    <label class="rate_star hand tooltips" for="star5" title="5 stars"></label>
+                                                    <input type="radio" class="rate_star_update" data-id="{{$proposal_details->id}}" id="star4" name="rate" value="4" @if($proposal_details->proposal_quality ==4) checked @endif/>
+                                                    <label class="rate_star hand tooltips" for="star4" title="4 stars"></label>
+                                                    <input type="radio" class="rate_star_update" data-id="{{$proposal_details->id}}" id="star3" name="rate" value="3" @if($proposal_details->proposal_quality ==3) checked @endif/>
+                                                    <label class="rate_star hand tooltips" for="star3" title="3 stars"></label>
+                                                    <input type="radio" class="rate_star_update" data-id="{{$proposal_details->id}}" id="star2" name="rate" value="2" @if($proposal_details->proposal_quality ==2) checked @endif/>
+                                                    <label class="rate_star hand tooltips" for="star2" title="2 stars"></label>
+                                                    <input type="radio" class="rate_star_update" data-id="{{$proposal_details->id}}" id="star1" name="rate" value="1"  @if($proposal_details->proposal_quality ==1) checked @endif/>
+                                                    <label class="rate_star hand tooltips" for="star1" title="1 star"></label> 
                                                 </span>
                                             </div>
                                             <div class="single_glance_row mt-1">
@@ -1058,7 +1093,7 @@ element.style {
                                                     <div class="mb-2">
                                                         <div class="form-icon position-relative">
                                                             <input type="hidden" name="p_status" id="p_status" value="">
-                                                            <textarea class="form-control" name="message" id="message" required=""></textarea>
+                                                            <textarea class="form-control" name="message" id="message" required="">{{$proposal_details->feedback_msg ?? ''}}</textarea>
                                                         </div>
                                                     </div>
                                                     <div class="text-end">
@@ -1271,6 +1306,22 @@ element.style {
       <script src="{{ asset('css/wait-me/waitMe.min.js')}}"></script>
 
       <script>
+
+        function wait_me(selector, config=null){
+
+            if(config){
+
+                selector.waitMe(config);
+
+            }else{ 
+
+                selector.waitMe({
+                    effect: 'facebook',
+                    //color: '#000',
+                    text: 'Please! Wait ...'
+                }); 
+            } 
+        }
         function pop_up_msg(msg='No message specified', type='success', callback=null){ 
             new Noty({
             theme:'sunset',
@@ -1294,7 +1345,32 @@ element.style {
             return msg;
 
         }
+
+
         $(function(){
+
+            $('.rate_star_update').on('click', function(){
+                var self =$(this);
+                var id =self.data('id');
+                var value =self.attr('value'); 
+
+                var form_data={
+                    _token: "{{ csrf_token() }}", 
+                    id: id, 
+                    value:value
+                }
+
+                $.post("{{ route('ajax-post', ['name'=>'proposal_quality_rate_star_update']) }}", form_data, function(res){ 
+                    pop_up_msg(res.msg);
+                    window.location.reload();
+
+                }).fail(function(err){
+
+                    pop_up_msg(err_msg(err), 'error');
+
+                }); 
+                
+            });
             $('.concept_change').on('click', function(){
                 var self =$(this);
                 var id =self.data('id');

+ 52 - 2
resources/views/teacher_profile.blade.php

@@ -583,8 +583,19 @@ tbody, td, tfoot, th, thead, tr {
                                                 </div>
                                             </td>
                                             <td style="font-size: 11px; text-align:center;">
+                                               
                                                 <div class="top_part_status">
-                                                    <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">Accept</button>
+                                                    @if($row->proposal_status ==1)
+                                                        <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">In Review</button>
+                                                    @elseif($row->proposal_status ==2)
+                                                        <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">Pause</button>
+                                                    @elseif($row->proposal_status ==3)
+                                                        <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">Rejected</button>
+                                                    @elseif($row->proposal_status ==4)
+                                                        <button class="btn btn2" style="padding: 1px 10px !important; font-size: 11px;">Interested</button>
+                                                    @else
+                                                    <button class="btn btn2 accept_status_update" data-id="{{$row->id}}" style="padding: 1px 10px !important; font-size: 11px;">Accept</button>
+                                                    @endif 
                                                 </div>
                                             </td>
                                         </tr>
@@ -1134,7 +1145,46 @@ tbody, td, tfoot, th, thead, tr {
 
                 }); 
             });
-        });
+
+
+            $('.accept_status_update').on('click', function(){
+                var self =$(this);
+                var id =self.data('id'); 
+
+                var form_data={
+                    _token :"{{csrf_token()}}",
+                    'id':id, 
+                 } 
+
+                swal({
+                    title: "Are you sure you want to change status?",
+                    text: "Please check before submitting!",
+                    type: "warning",
+                    showCancelButton: true,
+                    confirmButtonClass: "btn-danger",
+                    cancelButtonClass: "btn-info",
+                    confirmButtonText: "Yes",
+                    cancelButtonText: "No",
+                    closeOnConfirm: true,
+                    closeOnCancel: true
+                }, function(isConfirm){
+
+                    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){
+
+                            pop_up_msg(err_msg(err), 'error');
+
+                        });
+                    } 
+                }); 
+            }); 
+        
+
+  });
 
 
         // let answer = document.getElementById("interest").contentEditable;