Explorar o código

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

Israat Zarin hai 1 ano
pai
achega
e3191dc66b

+ 21 - 12
app/Http/Controllers/Admin/AdminController.php

@@ -15,7 +15,7 @@ use Hash;
 
 class AdminController extends Controller
 {
-    
+
     public function __construct(){
 
         $this->middleware('admin');
@@ -48,28 +48,37 @@ class AdminController extends Controller
                 'name','ASC'
             )->get();
 
-          
-        $market_countries = MarketCountry::where( 
+        $invited_registered_list =User::where(
+            'user_type',2
+        )->whereNotNull(
+            'admin_invite_id'
+        )->orderBy(
+            'name','ASC'
+        )->get();
+
+
+        $market_countries = MarketCountry::where(
                 'status', 1
             )->select(
                 'market_countries.*', \DB::raw('(SELECT name FROM countries WHERE market_countries.country_id = countries.id ) as sort')
             )->orderBy('sort')->get();
-            
+
         $refer_users =ReferUser::orderBy('id','DESC')->get();
 
         $data =[
-          'register_teachers_list'=>$register_teachers_list , 
-          'active_teachers_list'=>$active_teachers_list, 
-          'register_student_list'=>$register_student_list , 
-          'market_countries'=>$market_countries,  
-          'refer_users'=>$refer_users  
+          'register_teachers_list'=>$register_teachers_list ,
+          'active_teachers_list'=>$active_teachers_list,
+          'register_student_list'=>$register_student_list ,
+          'market_countries'=>$market_countries,
+          'refer_users'=>$refer_users,
+          'invited_registered_list'=>$invited_registered_list
         ];
         return view('admin.admin_profile',$data);
     }
 
 
-    public function load_country_list($text){ 
-        $selected = MarketCountry::pluck('country_id')->toArray(); 
+    public function load_country_list($text){
+        $selected = MarketCountry::pluck('country_id')->toArray();
         if($text == '0'){
             $countries = Country::where('status', 1)->paginate(10);
         }else{
@@ -79,5 +88,5 @@ class AdminController extends Controller
         return view('admin.loadCountry', compact('countries','selected'));
     }
 
-    
+
 }

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

@@ -464,7 +464,7 @@ class AjaxController extends Controller
                 );
             }
 
-        }elseif($name=="invited_registration"){ 
+        }elseif($name=="invited_registration"){
             $validator=\Validator::make($req->all(), [
                 'first_name'=>'required',
                 'last_name'=>'required',
@@ -513,6 +513,7 @@ class AjaxController extends Controller
                 $user_data->uni_website =$req->website;
                 $user_data->password =Hash::make($req->password);
                 $user_data->status =1;
+                $user_data->invited_registered_at = now();
                 $user_data->update();
 
                 return response(

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

@@ -4,6 +4,8 @@ namespace App\Http\Controllers;
 
 use Illuminate\Http\Request;
 use App\User;
+use App\Models\Department;
+use App\Models\University;
 use Auth;
 class HomeController extends Controller
 {

+ 9 - 9
app/Http/Controllers/ModalController.php

@@ -8,6 +8,7 @@ use App\Proposal;
 use App\User;
 use App\StudentProposal;
 use App\Models\ReferUser;
+use App\Models\Admin;
 use Hash;
 use DB;
 use Session;
@@ -45,12 +46,11 @@ class ModalController extends Controller{
             $user =Auth::guard('teacher')->user();
             $data['refer'] = new ReferUser;
 
-        }elseif($name=="admin_invited"){
-            $user =Auth::guard('admin')->user();
-            $data['refer'] = new ReferUser;
+        }elseif($name=="teacher_invited"){
+            $data['admin'] =Admin::find($req->id);
 
         }else $name='default';
-         
+
 
         return view("modal_pages.{$name}", $data);
     }
@@ -172,11 +172,12 @@ class ModalController extends Controller{
                 ['msg'=>'Refer saved successfully.']
             );
 
-        }elseif($name=="admin_invited"){
-            $admin =Auth::guard('admin')->user();
+        }elseif($name=="teacher_invited"){
+
+            $admin =Admin::find($req->id);
             $validator=\Validator::make($req->all(), [
                 'name'=>'required',
-                'email'=>'required|email|max:255|unique:refer_users'
+                'email'=>'required|email|max:255'
             ]);
 
             if($validator->fails()){
@@ -199,7 +200,7 @@ class ModalController extends Controller{
             $refer->save();
 
             if($refer->save()){
-                $data['name'] = $refer->name;   
+                $data['name'] = $refer->name;
                 $data['teacher_id'] = $user_data->id;
                 $data['applicant_name'] = $admin->first_name.' '.$admin->last_name;
                 $user_mail = $refer->email;
@@ -214,7 +215,6 @@ class ModalController extends Controller{
             return response(
                 ['msg'=>'Invite saved successfully.']
             );
-
         }
 
         return response(['msg'=>'No name argument found.'], 403);

BIN=BIN
public.zip


+ 26 - 74
resources/views/admin/admin_profile.blade.php

@@ -395,7 +395,7 @@ tbody, td, tfoot, th, thead, tr {
                             <div class="col-md-2" style="display:flex; justify-content: end;">
                                 <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'=>'admin_invited'])}}" data-title="Invite">
+                                        <a href="javascript:void(0)" class="open_modal_page" data-url="{{route('modal-get',['name'=>'teacher_invited','id'=>auth_user('admin')->id])}}" data-title="Invite">
                                         <button class="btn btn2" style="padding: 6px 10px !important;">New lead</button>
                                         </a>
                                     </li>
@@ -414,7 +414,7 @@ tbody, td, tfoot, th, thead, tr {
                                         </a>
                                     </li>
                                 </ul> -->
-                                 
+
                                 <ul class="nav navbar-nav align-items-center ml-auto header_right ps-1">
                                     <li class="nav-item dropdown dropdown-notification">
                                         <a href="">
@@ -513,8 +513,8 @@ tbody, td, tfoot, th, thead, tr {
                                             <th>Student Information</th>
                                             <th>Teacher Information</th>
                                             <th>Proposal Summary</th>
-                                            <th>Applied on</th>                                                                           
-                                            <th>Status</th>                                                                           
+                                            <th>Applied on</th>
+                                            <th>Status</th>
                                         </tr>
                                     </thead>
                                     <tbody>
@@ -586,9 +586,9 @@ tbody, td, tfoot, th, thead, tr {
                                     </ul>
                                 </div>
                                 <div class="col-md-12">
-                                    <div class="row align-items-center"> 
-                                        <div class="card rounded border-0 p-2" style="background-color:white;">   
- 
+                                    <div class="row align-items-center">
+                                        <div class="card rounded border-0 p-2" style="background-color:white;">
+
                                             <div class="row">
                                                 <div class="tab-content" id="pills-tabContent">
                                                     <div class="card border-0 tab-pane fade show active" id="registers" role="tabpanel" aria-labelledby="student-register">
@@ -745,8 +745,8 @@ tbody, td, tfoot, th, thead, tr {
                                 </div>
                                 <div class="col-md-12">
                                     <div class="row align-items-center">
-                                        <div class="col-md-12 mb-3" style="padding:0px;"> 
-                                            <div class="card rounded border-0 p-3" style="background-color:white;"> 
+                                        <div class="col-md-12 mb-3" style="padding:0px;">
+                                            <div class="card rounded border-0 p-3" style="background-color:white;">
                                                 <div class="row">
                                                     <div class="col-12">
                                                         <div class="tab-content" id="pills-tabContent">
@@ -915,20 +915,26 @@ tbody, td, tfoot, th, thead, tr {
                                                                                         <th>Name</th>
                                                                                         <th>Email</th>
                                                                                         <th>Invited on</th>
-                                                                                        <th>Registered</th>                                                                           
+                                                                                        <th>Registered</th>
                                                                                     </tr>
                                                                                 </thead>
+
                                                                                 <tbody>
-                                                                                    <tr>
-                                                                                        <td style="font-size: 11px;">-</td>
-                                                                                        <td style="font-size: 11px; width: 22%;">-</td>
-                                                                                        <td style="font-size: 11px; width: 30%;">-</td>
-                                                                                        <td style="font-size: 11px;">-</td>
-                                                                                        <td style="font-size: 11px;">-</td>
-                                                                                    </tr>
-                                                                                    <!-- <tr>
-                                                                                        <td colspan="5" class="text-center text-danger">No data found!</td>
-                                                                                    </tr> -->
+                                                                                    @if(count($invited_registered_list) >0)
+                                                                                        @foreach($invited_registered_list as $key=>$row)
+                                                                                            <tr>
+                                                                                                <td style="font-size: 11px;">{{ ++$key }}</td>
+                                                                                                <td style="font-size: 11px; width: 22%;">{{ $row->first_name }}  {{ $row->last_name }}</td>
+                                                                                                <td style="font-size: 11px; width: 30%;">{{ $row->email }}</td>
+                                                                                                <td style="font-size: 11px;">{{ date('d M Y', strtotime($row->created_at)) }}</td>
+                                                                                                <td style="font-size: 11px;">@if(!empty($row->registered_at)) {{ date('d M Y', strtotime($row->registered_at)) }} @else -- @endif</td>
+                                                                                            </tr>
+                                                                                        @endforeach
+                                                                                        @else
+                                                                                            <tr>
+                                                                                                <td colspan="5" class="text-center text-danger">No data found!</td>
+                                                                                            </tr>
+                                                                                    @endif
                                                                                 </tbody>
                                                                             </table>
                                                                         </div>
@@ -1153,60 +1159,6 @@ tbody, td, tfoot, th, thead, tr {
         }
 
 
-        function ajax_form(form, cllback=null, config={spinner: true}){
-
-            $('.btn-submit').prop('disabled', true);
-            var redirect=$(form).data('redirect');
-
-            if(typeof config=='object'){
-
-            if(config.spinner) wait_me($(form));
-
-            }
-
-            $(form).ajaxSubmit({
-            success:function(res){
-
-                wait_me($(form), 'hide');
-
-                if(res.msg){
-
-                pop_up_msg(res.msg, 'success', function(){
-
-                    //$('.btn-submit').prop('disabled', false);
-
-                    if(redirect) window.location.replace(redirect);
-                    else if(typeof cllback=='function'){
-                    cllback(form);
-                    }
-
-                });
-
-                }
-
-                //$.notify(res.msg, 'success');
-            },
-            error:function(res){
-
-                wait_me($(form), 'hide');
-
-                var msg="Request failed to process, try again later.";
-
-                if(res.responseJSON && res.responseJSON.msg){
-                msg=res.responseJSON.msg;
-                }
-
-                pop_up_msg(msg, 'error');
-                $('.btn-submit').prop('disabled', false);
-
-            }
-
-            });
-
-            } //End of ajax form definition
-
-
-
         function pop_up_msg(msg='No message specified', type='success', callback=null){
             new Noty({
             theme:'sunset',

+ 3 - 9
resources/views/auth/invited_register_form.blade.php

@@ -118,9 +118,7 @@
     }
     </style>
     <body>
-        @php
-           $countries=DB::table('countries')->get();
-        @endphp
+
         <section class="cover-user">
             <div class="container-fluid px-0">
                 <div class="row g-0 position-relative">
@@ -181,12 +179,12 @@
                                                     </div>
                                                 </div>
                                                 <div class="row mb-3">
-                                                <div class="col-md-12 others_department" style="display:none;"> 
+                                                <div class="col-md-12 others_department" style="display:none;">
                                                         <div class="form-icon position-relative">
                                                             <input type="text" class="form-control" name="others_department" id="others_department" placeholder="Others department name">
                                                         </div>
                                                     </div>
-                                                </div> 
+                                                </div>
                                                 <div class="row mb-4">
                                                     <div class="col-md-12">
                                                         <input type="text" class="form-control" name="designation" id="designation" placeholder="Please enter your designation here" required="" autocomplete="off">
@@ -272,10 +270,6 @@
 
         $(function(){
 
-            $("#u_dob").flatpickr({
-                dateFormat: "d M Y",
-            });
-
             $('#invited_registration').on('click', function(){
                   var id =$('#teacher_id').val();
                   var first_name =$('#first_name').val();

+ 1 - 1
resources/views/email/teacher_invited_email.blade.php

@@ -90,7 +90,7 @@
                                 <p class="mt-2"> The best part? Many faculties across the world are already using this tool, and it has been proven to be effective in streamlining the application process for doctoral applicants.</p>
                                 <p class="mt-2"> At this point, registration is by invitation only, and we would like to extend an invitation to you to explore the many features that this tool offers. Your data will be 100% secure and will not be accessible or shared with any third party.</p>
                                 <p class="mt-2"> To get started, please follow the link below to create your account and begin exploring the system's features.</p>
-                                <a href="{{ url('register/'.$hashids->encode($teacher_id)) }}"> click here</a>
+                                <a href="{{ url('register-v2/'.$hashids->encode($teacher_id)) }}"> click here</a>
                                 <p class="mt-2"> Thank you for your time, and we hope you find this tool as helpful as we have.</p>
                                 <p class="mt-2" style="margin: 0px;">Best regards,</p>
                                 <h4> Research Admission  </h4>

+ 16 - 14
resources/views/modal_pages/add_wishlist.blade.php

@@ -7,9 +7,9 @@
         margin-right: 5px;
     }
     .btn1{
-    background-color: #141639c4 !important; 
-    color:white !important; 
-    border-radius: 20px; 
+    background-color: #141639c4 !important;
+    color:white !important;
+    border-radius: 20px;
     box-shadow:none !important;
     }
     .btn1:hover{
@@ -20,7 +20,7 @@
     }
 </style>
 @section('main')
- 
+
     <div class="container" style="background-color: white; border-radius: 6px;">
         <div class="row">
             <div class="co-md-12 p-3">
@@ -34,7 +34,7 @@
                                     <input type="name" class="form-control" placeholder="Full Name" name="name" required="">
                                 </div>
                             </div>
-                        </div>    
+                        </div>
                         <div class="col-lg-12" style="margin-top:-18px;">
                             <div class="mb-3">
                                 <label class="form-label"></label>
@@ -52,16 +52,18 @@
                             </div>
                         </div>
                     </div>
-                </form>  
+                </form>
             </div>
-        </div> 
-    </div>  
-<script>
-    
+        </div>
+    </div>
+
+   <script>
     $(function(){
-        // $('.select2').select2();
         $('#modal_page_footer').hide();
-        
-    )};
+
+    });
+
     </script>
-@endsection
+
+
+@endsection

+ 17 - 14
resources/views/modal_pages/admin_invited.blade.php → resources/views/modal_pages/teacher_invited.blade.php

@@ -7,9 +7,9 @@
         margin-right: 5px;
     }
     .btn1{
-    background-color: #141639c4 !important; 
-    color:white !important; 
-    border-radius: 20px; 
+    background-color: #141639c4 !important;
+    color:white !important;
+    border-radius: 20px;
     box-shadow:none !important;
     }
     .btn1:hover{
@@ -20,12 +20,13 @@
     }
 </style>
 @section('main')
- 
+
     <div class="container" style="background-color: white; border-radius: 6px;">
         <div class="row">
             <div class="co-md-12 p-3">
                 <form class="ajax-form" action="{{ url()->current() }}" method="POST" enctype="multipart/form-data">
                 {{ csrf_field() }}
+                <input type="hidden" name="id" value="{{ $admin->id }}">
                     <div class="row">
                         <div class="col-md-12">
                             <div class="mb-3">
@@ -34,7 +35,7 @@
                                     <input type="name" class="form-control" placeholder="Full Name" name="name" required="">
                                 </div>
                             </div>
-                        </div>    
+                        </div>
                         <div class="col-lg-12" style="margin-top:-18px;">
                             <div class="mb-3">
                                 <label class="form-label"></label>
@@ -52,16 +53,18 @@
                             </div>
                         </div>
                     </div>
-                </form>  
+                </form>
             </div>
-        </div> 
-    </div>  
-<script>
-    
+        </div>
+    </div>
+
+   <script>
     $(function(){
-        // $('.select2').select2();
         $('#modal_page_footer').hide();
-        
-    )};
+
+    });
+
     </script>
-@endsection
+
+
+@endsection

+ 5 - 0
sql/update.sql

@@ -118,3 +118,8 @@ ALTER TABLE `users`
 
 ALTER TABLE `users`
 	ADD COLUMN `admin_invite_id` INT(11) NULL DEFAULT NULL AFTER `wishlist_teacher_id`;
+
+
+
+ALTER TABLE `users`
+	ADD COLUMN `registered_at` DATETIME NULL DEFAULT NULL AFTER `is_test_score`;