changes
This commit is contained in:
@@ -33,29 +33,6 @@ class ManageReferralController extends Controller
|
||||
return view('Admin.pages.manage_rule.manage_referral_edit', compact('referral_rule'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Created By : sayali parab
|
||||
* Created at : 22 July 2024
|
||||
* Use : To update Rules.
|
||||
*/
|
||||
|
||||
// public function updateReferral(Request $request)
|
||||
// {
|
||||
// $validated = $request->validate([
|
||||
|
||||
// 'article_des_title' => 'required',
|
||||
// 'article_des_message' => 'required',
|
||||
// 'article_des_referral' => 'required',
|
||||
|
||||
// ]);
|
||||
// $update = ManageReferralRule::find($request->rule_id);
|
||||
// $update->how_it_works= $request->input('article_des_title');
|
||||
// $update->rules = $request->input('article_des_message');
|
||||
// $update->what_is_referral= $request->input('article_des_referral');
|
||||
|
||||
// $update->save();
|
||||
// return response()->json(['success' => true, 'status' => 200]);
|
||||
// }
|
||||
|
||||
public function updateReferral(Request $request)
|
||||
{
|
||||
@@ -66,14 +43,22 @@ class ManageReferralController extends Controller
|
||||
'what_is_referral' => 'required',
|
||||
|
||||
]);
|
||||
|
||||
$howItWorks = urldecode($request->input('how_it_works'));
|
||||
$rules = urldecode($request->input('rules'));
|
||||
$whatIsReferral = urldecode($request->input('what_is_referral'));
|
||||
|
||||
|
||||
$update = ManageReferralRule::find($request->rule_id);
|
||||
$update->how_it_works= $request->input('how_it_works');
|
||||
$update->rules = $request->input('rules');
|
||||
$update->what_is_referral= $request->input('what_is_referral');
|
||||
$update->how_it_works= $howItWorks;
|
||||
$update->rules = $rules;
|
||||
$update->what_is_referral= $whatIsReferral;
|
||||
|
||||
$update->save();
|
||||
// dd($update);
|
||||
return response()->json(['success' => true, 'status' => 200]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,23 +33,23 @@
|
||||
aria-labelledby="home-tab" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<h4>
|
||||
How it works :
|
||||
</p>
|
||||
</h4>
|
||||
<p>
|
||||
{!! $referral_rule[0]['how_it_works'] !!}
|
||||
|
||||
</p>
|
||||
<p>
|
||||
<h4>
|
||||
Rules :
|
||||
</p>
|
||||
</h4>
|
||||
<p>
|
||||
{!! $referral_rule[0]['rules'] !!}
|
||||
|
||||
</p>
|
||||
<p>
|
||||
<h4>
|
||||
What_is_referral :
|
||||
</p>
|
||||
</h4>
|
||||
<p>
|
||||
{!! $referral_rule[0]['what_is_referral'] !!}
|
||||
|
||||
|
||||
@@ -86,10 +86,7 @@
|
||||
@endsection
|
||||
|
||||
@section('section_script')
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@@ -146,10 +143,15 @@ $(document).ready(function() {
|
||||
},
|
||||
errorClass: 'error-message',
|
||||
submitHandler: function(form) {
|
||||
// Update hidden inputs with the content from Quill editors
|
||||
$('input[name="how_it_works"]').val(quillTitle.root.innerHTML);
|
||||
$('input[name="rules"]').val(quillMessage.root.innerHTML);
|
||||
$('input[name="what_is_referral"]').val(quillReferral.root.innerHTML);
|
||||
// Encode the content from Quill editors
|
||||
var encodedTitle = encodeURIComponent(quillTitle.root.innerHTML);
|
||||
var encodedMessage = encodeURIComponent(quillMessage.root.innerHTML);
|
||||
var encodedReferral = encodeURIComponent(quillReferral.root.innerHTML);
|
||||
|
||||
// Update hidden inputs with the encoded content
|
||||
$('input[name="how_it_works"]').val(encodedTitle);
|
||||
$('input[name="rules"]').val(encodedMessage);
|
||||
$('input[name="what_is_referral"]').val(encodedReferral);
|
||||
|
||||
var formData = new FormData(form);
|
||||
|
||||
@@ -185,3 +187,5 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
aria-labelledby="home-tab" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<h4>
|
||||
What's Inside ?
|
||||
</p>
|
||||
</h4>
|
||||
<p>
|
||||
{!! $data[0]['whats_inside'] !!}
|
||||
</p>
|
||||
<p>
|
||||
<h4>
|
||||
Rules
|
||||
</p>
|
||||
</h4>
|
||||
<p>
|
||||
{!! $data[0]['rules'] !!}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user