|
@@ -50,13 +50,13 @@
|
|
|
<p class="mb-1" style="font-size:14px; font-weight:bold !important; color: #141639c4;">Refer a Friend</p>
|
|
|
<p style="font-size: 13px;">Earn points by referring your friends or colleagues to register and submit their first application. Once they submit their application, you will receive the points.</p>
|
|
|
<div class="col-md-12">
|
|
|
- <form class="login-form">
|
|
|
+
|
|
|
<div class="row">
|
|
|
<div class="col-md-12">
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label"></label>
|
|
|
<div class="form-icon position-relative">
|
|
|
- <input type="name" class="form-control" placeholder="Full Name" name="name" required="">
|
|
|
+ <input type="text" class="form-control" id="ref_name" placeholder="Full Name" name="name" required="">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -64,20 +64,20 @@
|
|
|
<div class="mb-3">
|
|
|
<label class="form-label"></label>
|
|
|
<div class="form-icon position-relative">
|
|
|
- <input type="email" class="form-control" placeholder="Email Address" name="email" required="">
|
|
|
+ <input type="email" class="form-control" id="ref_email" placeholder="Email Address" name="email" required="">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div><!--end col-->
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
<div class="mt-2 mb-4 text-center">
|
|
|
- <button type="submit" class="btn btn1" style="padding: 3px 18px;">
|
|
|
+ <button type="submit" class="btn btn1 refer_btn" style="padding: 3px 18px;">
|
|
|
{{ __('Invite Now') }}
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </form>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -157,6 +157,30 @@
|
|
|
@push('js')
|
|
|
|
|
|
<script>
|
|
|
+ function pop_up_msg(msg='No message specified', type='success', callback=null){
|
|
|
+ new Noty({
|
|
|
+ theme:'sunset',
|
|
|
+ text: msg,
|
|
|
+ type: type,
|
|
|
+ timeout:1500,
|
|
|
+ callbacks:{
|
|
|
+ afterClose: callback
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+
|
|
|
+ function err_msg(err){
|
|
|
+
|
|
|
+ var msg="Request failed to process, try again later.";
|
|
|
+
|
|
|
+ if(err.responseJSON && err.responseJSON.msg){
|
|
|
+ msg=err.responseJSON.msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ return msg;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
$(function(){
|
|
|
$('.search_button').on('click', function(){
|
|
|
get_data();
|
|
@@ -183,7 +207,29 @@
|
|
|
pop_up_error_msg('Please type a Teacher Reference No.');
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $('.refer_btn').on('click', function(){
|
|
|
+
|
|
|
+ var name =$('#ref_name').val();
|
|
|
+ var email =$('#ref_email').val();
|
|
|
+
|
|
|
+ var form_data={
|
|
|
+ _token: "{{ csrf_token() }}",
|
|
|
+ name: name,
|
|
|
+ email: email,
|
|
|
+ }
|
|
|
+
|
|
|
+ $.post("{{ route('ajax-post', ['name'=>'add_refer_user']) }}", form_data, function(res){
|
|
|
+ pop_up_msg(res.msg);
|
|
|
+
|
|
|
+ }).fail(function(err){
|
|
|
+
|
|
|
+ pop_up_msg(err_msg(err), 'error');
|
|
|
+
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
</script>
|