Dashboard

This commit is contained in:
sayaliparab
2024-06-05 20:10:10 +05:30
parent 5a2468dd82
commit 61d54f8102
15 changed files with 715 additions and 230 deletions

View File

@@ -2,14 +2,24 @@
namespace App\Http\Controllers\Admin\APIs\RestaurantApi;
use App\Models\NotificationDetails;
use Illuminate\Support\Facades\Validator;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Helpers\onesignalhelper;
use App\Models\IamPrincipal;
use Illuminate\Support\Facades\Log;
use Exception;
class RestNotificationController extends Controller
{
/**
* Created By :sayali parab
* Created at : 4 June 2024
* Use : To get notification.
*/
public function getRestNotificationApi(Request $request)
{
try {
@@ -46,7 +56,11 @@ class RestNotificationController extends Controller
}
}
/**
* Created By :sayali parab
* Created at : 4 June 2024
* Use : To send notification.
*/
public function sendRestNotificationApi(Request $request)
{
try {
@@ -73,4 +87,42 @@ class RestNotificationController extends Controller
]);
}
}
/**
* Created By :sayali parab
* Created at : 4 June 2024
* Use : To alert notification.
*/
public function sendAlertNotificationApi(Request $request)
{
try {
$token = readRestHeaderToken();
if ($token) {
$iam_principal_id = $token['sub'];
$validator = Validator::make($request->all(), [
'status' => 'required|in:0,1',
]);
if ($validator->fails()) {
return jsonResponseWithErrorMessageApi($validator->errors()->first(), 400);
}
$imPrincipal = IamPrincipal::where('id', $iam_principal_id)->first();
if (!$imPrincipal) {
return jsonResponseWithErrorMessageApi(__('auth.user_not_found'), 404);
}
$imPrincipal->notification_status = $request->status;
$imPrincipal->save();
return jsonResponseWithSuccessMessage(__('auth.data_updated_successfully'), 200);
} else {
return jsonResponseWithErrorMessageApi(__('auth.user_not_found'), 409);
}
} catch (Exception $e) {
Log::error('Contact form controller function failed: ' . $e);
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
}

View File

@@ -16,64 +16,55 @@ use Illuminate\Support\Facades\Auth;
class AboutUsController extends Controller
{
/**
* Created By : sayali parab
* Created at : 20 May 2024
* Use : To view about us page.
*/
public function index()
{ $view_about = Aboutus::get()->toArray();
{
$view_about = Aboutus::get()->toArray();
return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us',compact('view_about'));
return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us', compact('view_about'));
}
/**
* Created By : sayali parab
* Created at : 20 May 2024
* Use : To edit about us page.
*/
// public function index(Request $request)
// {
// try {
// $about_data = Aboutus::with('category')->get();
// // @dd($about_data);
// foreach ($about_data as $k => $val) {
// $about_data[$k]['thumbnail_image'] = ListingImageUrl('about_images', $val['thumbnail_image']);
// }
// return view('Admin.pages.manage_cms.manage_aboutus.manage_aboutsus', compact('about_data'));
// } catch (Exception $e) {
// Log::error("Manage About Page Not Load " . $e->getMessage());
// return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
// }
// }
// public function edit($id)
// {
// try {
// $edit_service = Aboutus::find($id)->toArray();
// $about_us_cat = MainCategory::all()->toArray();
// $edit_service['thumbnail_image'] = ListingImageUrl('about_images', $edit_service['thumbnail_image']);
// return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_edit', compact('edit_service', 'about_us_cat'));
// } catch (Exception $e) {
// Log::error("edit voucher Page Load Failed " . $e->getMessage());
// return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
// }
// }
public function edit($id){
public function edit($id)
{
$edit_privacy_policy = Aboutus::find($id)->toArray();
return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_cust', compact('edit_privacy_policy'));
}
/**
* Created By : sayali parab
* Created at : 20 May 2024
* Use : To edit about us page.
*/
public function edit_rest($id)
{
$edit_about_rest = Aboutus::find($id)->toArray();
dd('sdfnkjfn');
// dd('sdfnkjfn');
return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_rest', compact('edit_about_rest'));
}
/**
* Created By : sayali parab
* Created at : 20 May 2024
* Use : To update about us page.
*/
public function update(Request $request)
{
try {
DB::beginTransaction();
@@ -102,11 +93,15 @@ class AboutUsController extends Controller
}
}
/**
* Created By : sayali parab
* Created at : 21 May 2024
* Use : To delete about us page.
*/
public function delete_about($id)
{
try {
$blog = Aboutus::find($id);
@@ -122,9 +117,15 @@ class AboutUsController extends Controller
return response()->json(['error' => 'An error occurred while deleting the Aboutus entry.'], 500);
}
}
/**
* Created By : sayali parab
* Created at : 21 May 2024
* Use : To change status about us page.
*/
public function change_about_Status(Request $request)
{
try {
$status = Aboutus::find($request->program_id);
@@ -142,16 +143,24 @@ class AboutUsController extends Controller
return response()->json(['error' => 'An error occurred while changing the status.'], 500);
}
}
/**
* Created By : sayali parab
* Created at : 21 May 2024
* Use : To add about us page.
*/
public function add()
{
$about_us_cat = MainCategory::all()->toArray();
return view('Admin.pages.manage_cms.manage_aboutus.manage_about_us_add', compact('about_us_cat'));
}
/**
* Created By : sayali parab
* Created at : 21 May 2024
* Use : To insert about us page.
*/
public function insert(Request $request)
{
try {
DB::beginTransaction();
@@ -182,5 +191,4 @@ class AboutUsController extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
}

View File

@@ -11,6 +11,12 @@ use App\Models\ManageRestaurant;
class DashboardController extends Controller
{
/**
* Created By : sayali parab
* Created at : 16 May 2024
* Use : To show the dashboard.
*/
// public function showDashboard(){
@@ -84,6 +90,7 @@ class DashboardController extends Controller
->pluck('count', 'month')
->toArray();
// dd($dataMonthlyWithType3);
// return $dataMonthlyWithType3;
$dataMonthlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
->whereIn('principal_type_xid', [4])
@@ -149,7 +156,138 @@ class DashboardController extends Controller
// Pass the data to the view
// return view('Admin.dashboard', compact('customerCount', 'activePassports', 'restaurantCount', 'recent_transaction', 'datas', 'formattedDefaultData', 'quarterlyData', 'yearlyData', 'dataMonthlyWithType3', 'dataMonthlyWithType4', 'dataQuarterlyWithType3', 'dataQuarterlyWithType4', 'dataYearlyWithType3', 'dataYearlyWithType4','formattedDailyData'));
return view('Admin.dashboard', compact('customerCount','restaurantCount','dataMonthlyWithType3','dataMonthlyWithType4','dataQuarterlyWithType3', 'dataQuarterlyWithType4', 'dataYearlyWithType3', 'dataYearlyWithType4'));
return view('Admin.dashboard', compact('customerCount','restaurantCount','dataMonthlyWithType3','dataMonthlyWithType4','dataQuarterlyWithType3', 'dataQuarterlyWithType4', 'dataYearlyWithType3', 'dataYearlyWithType4','formattedDefaultData','quarterlyData'));
}
// public function showDashboard()
// {
// // Fetching data for sorting by day
// // $dailyData = OrderedPassport::select(DB::raw("COUNT(*) as count"), DB::raw("DATE(created_at) as date"))
// // ->whereBetween('created_at', [now()->subDays(7), now()]) // Fetch data for the last 7 days
// // ->groupBy(DB::raw("DATE(created_at)"))
// // ->orderBy(DB::raw("DATE(created_at)"))
// // ->pluck('count', 'date')
// // ->toArray();
// // Ensure that $dailyData contains zeros for days with no data
// $start_date = now()->subDays(7)->startOfDay();
// $end_date = now()->endOfDay();
// $formattedDailyData = [];
// while ($start_date <= $end_date) {
// $formattedDailyData[$start_date->format('Y-m-d')] = isset($dailyData[$start_date->format('Y-m-d')]) ? $dailyData[$start_date->format('Y-m-d')] : 0;
// $start_date->addDay();
// }
// // Default sales chart data (monthly)
// // $defaultData = OrderedPassport::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
// // ->whereYear('created_at', date('Y'))
// // ->groupBy(DB::raw("MONTH(created_at)"))
// // ->orderBy(DB::raw("MONTH(created_at)"))
// // ->pluck('count', 'month')
// // ->toArray();
// // Ensure that $defaultData contains zeros for months with no data
// $months = range(1, 12);
// $formattedDefaultData = [];
// foreach ($months as $month) {
// $formattedDefaultData[$month] = isset($defaultData[$month]) ? $defaultData[$month] : 0;
// }
// // $quarterlyData = OrderedPassport::select(
// // DB::raw("COUNT(*) as count"),
// // DB::raw("QUARTER(created_at) as quarter")
// // )
// // ->whereYear('created_at', date('Y'))
// // ->groupBy(DB::raw("QUARTER(created_at)"))
// // ->orderBy(DB::raw("QUARTER(created_at)"))
// // ->pluck('count', 'quarter')
// // ->toArray();
// // Ensure that $quarterlyData contains zeros for quarters with no data
// for ($i = 1; $i <= 4; $i++) {
// if (!isset($quarterlyData[$i])) {
// $quarterlyData[$i] = 0;
// }
// }
// // Fetching data for yearly option
// // $yearlyData = OrderedPassport::select(DB::raw("COUNT(*) as count"), DB::raw("YEAR(created_at) as year"))
// // ->groupBy(DB::raw("YEAR(created_at)"))
// // ->pluck('count', 'year')
// // ->toArray();
// //
// // Monthly data
// $dataMonthlyWithType3 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
// ->whereIn('principal_type_xid', [3])
// ->whereYear('created_at', date('Y'))
// ->groupBy(DB::raw("MONTH(created_at)"))
// ->orderBy(DB::raw("MONTH(created_at)"))
// ->pluck('count', 'month')
// ->toArray();
// $dataMonthlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("MONTH(created_at) as month"))
// ->whereIn('principal_type_xid', [4])
// ->whereYear('created_at', date('Y'))
// ->groupBy(DB::raw("MONTH(created_at)"))
// ->orderBy(DB::raw("MONTH(created_at)"))
// ->pluck('count', 'month')
// ->toArray();
// // Quarterly data
// $dataQuarterlyWithType3 = IamPrincipal::select(
// DB::raw("COUNT(*) as count"),
// DB::raw("QUARTER(created_at) as quarter")
// )
// ->whereIn('principal_type_xid', [3])
// ->groupBy(DB::raw("QUARTER(created_at)"))
// ->orderBy(DB::raw("QUARTER(created_at)"))
// ->pluck('count', 'quarter')
// ->toArray();
// for ($i = 1; $i <= 4; $i++) {
// if (!isset($dataQuarterlyWithType3[$i])) {
// $dataQuarterlyWithType3[$i] = 0;
// }
// }
// $dataQuarterlyWithType4 = IamPrincipal::select(
// DB::raw("COUNT(*) as count"),
// DB::raw("QUARTER(created_at) as quarter")
// )
// ->whereIn('principal_type_xid', [4])
// ->groupBy(DB::raw("QUARTER(created_at)"))
// ->orderBy(DB::raw("QUARTER(created_at)"))
// ->pluck('count', 'quarter')
// ->toArray();
// for ($i = 1; $i <= 4; $i++) {
// if (!isset($dataQuarterlyWithType4[$i])) {
// $dataQuarterlyWithType4[$i] = 0;
// }
// }
// // Yearly data
// $dataYearlyWithType3 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("YEAR(created_at) as year"))
// ->whereIn('principal_type_xid', [3])
// ->groupBy(DB::raw("YEAR(created_at)"))
// ->pluck('count', 'year')
// ->toArray();
// // dd($dataYearlyWithType3);
// $dataYearlyWithType4 = IamPrincipal::select(DB::raw("COUNT(*) as count"), DB::raw("YEAR(created_at) as year"))
// ->whereIn('principal_type_xid', [4])
// ->groupBy(DB::raw("YEAR(created_at)"))
// ->pluck('count', 'year')
// ->toArray();
// $customerCount = IamPrincipal::where('principal_type_xid', '=', 3)->count();
// // $activePassports = ManagePassport::where('is_active', 1)->take(12)->get();
// // $restaurantCount = MyPassportVoucher::where('is_redeem', 1)->count();
// // $recent_transaction = OrderedPassport::with('order', 'order_passport', 'carts.passport', 'iamPrincipal')->get()->toArray();
// // $datas = MyPassportVoucher::with('passportVouchers', 'passportData', 'customer')->get()->toArray();
// // Pass the data to the view
// return view('Admin.dashboard', compact('customerCount', '', 'restaurantCount', '', 'datas', 'formattedDefaultData', 'quarterlyData', 'yearlyData', 'dataMonthlyWithType3', 'dataMonthlyWithType4', 'dataQuarterlyWithType3', 'dataQuarterlyWithType4', 'dataYearlyWithType3', 'dataYearlyWithType4','formattedDailyData'));
// }
}

View File

@@ -10,19 +10,33 @@ use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class FaqController extends Controller
{
{
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To get faq page.
*/
protected $faqServices;
public function __construct(faqServices $faqServices)
{
$this->faqServices = $faqServices;
}
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To get faq page.
*/
public function index()
{
$data = $this->faqServices->viewfaq();
return view('Admin.pages.manage_cms.manage_faq.manage_faq')->with($data);
}
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To change the status of faq page.
*/
public function change_faqStatus(Request $request)
{
$status = Faq::find($request->program_id);
@@ -31,7 +45,11 @@ class FaqController extends Controller
return response()->json(['success' => 'Status change successfully.']);
}
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To delete faq page.
*/
public function delete_faq($id)
{
$faq = Faq::find($id);
@@ -42,7 +60,11 @@ class FaqController extends Controller
$faq->delete();
return response()->json(['success' => true, 'status' => 200]);
}
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To update faq page.
*/
public function update(Request $request)
{
$faq = new Faq();
@@ -53,7 +75,11 @@ class FaqController extends Controller
$faq->save();
return response()->json(['success' => true, 'status' => 200]);
}
/**
* Created By : sayali parab
* Created at : 24 May 2024
* Use : To store faq page.
*/
public function store(Request $request)
{
try {

View File

@@ -9,7 +9,11 @@ use App\Models\ManageContactus;
use Illuminate\Support\Facades\Mail;
class ManageContactUsController extends Controller
{
{ /**
* Created By : sayali parab
* Created at : 05 June 2024
* Use : To get contact us page.
*/
public function index(){
// $queries = ManageContactUs::latest()->get();
$queries = ManageContactUs::all();

View File

@@ -23,6 +23,11 @@ use PDF;
class ManageCustomerController extends Controller
{
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get User Page.
*/
public function index()
{
try {
@@ -38,7 +43,11 @@ class ManageCustomerController extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get Passport Page.
*/
public function view_customer($id)
{
@@ -51,7 +60,11 @@ class ManageCustomerController extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get Customer data.
*/
public function edit_customer($id)
{
@@ -64,7 +77,11 @@ class ManageCustomerController extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Update Customer Form.
*/
public function update(Request $request)
{
@@ -91,10 +108,10 @@ class ManageCustomerController extends Controller
public function archive_customer()
{
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get archieve customer.
*/
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get archieve customer.
*/
try {
$customers = IamPrincipal::where('principal_type_xid', 3)->onlyTrashed()->latest()->get();
return view('Admin.pages.manage_users.manage_customer.archive_manage_customer', compact('customers'));
@@ -104,7 +121,11 @@ class ManageCustomerController extends Controller
}
}
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get delete customer.
*/
public function delete_customer($id)
{
@@ -127,7 +148,11 @@ class ManageCustomerController extends Controller
return response()->json(['success' => false, 'status' => 500, 'message' => __('auth.something_went_wrong')]);
}
}
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Get pdf.
*/
public function download_pdf($id)
{
try {
@@ -163,7 +188,11 @@ class ManageCustomerController extends Controller
// }
// }
/*
Created By : Sayali Parab
Created at : 28 May 2024
Use : To Deleted Data Restore.
*/
public function unarchive_customer($id)
{

View File

@@ -7,6 +7,12 @@ use Illuminate\Http\Request;
class ManageFeedbackController extends Controller
{
/**
* Created By : sayali parab
* Created at : 17 May 2024
* Use : To get manage feedback page.
*/
public function index(){
return view('Admin.pages.manage_feedback.manage_feedback');

View File

@@ -14,7 +14,11 @@ use Validator;
class ManageNewsAndArticlesController extends Controller
{
/**
* Created By : sayali parab
* Created at : 27 May 2024
* Use : To get newsarticle page.
*/
public function index()
{
@@ -30,7 +34,11 @@ class ManageNewsAndArticlesController extends Controller
}
/**
* Created By : sayali parab
* Created at : 27 May 2024
* Use : To change status.
*/
public function change_news_article_Status(Request $request)
{
@@ -52,7 +60,11 @@ class ManageNewsAndArticlesController extends Controller
}
}
/**
* Created By : sayali parab
* Created at : 27 May 2024
* Use : To edit.
*/
public function edit($id)
{
@@ -108,6 +120,13 @@ class ManageNewsAndArticlesController extends Controller
// return response()->json(['success' => false, 'error' => $e->getMessage(), 'status' => 500]);
// }
// }
/**
* Created By : sayali parab
* Created at : 27 May 2024
* Use : To update.
*/
public function update(Request $request)
{
try {
@@ -137,7 +156,11 @@ class ManageNewsAndArticlesController extends Controller
return response()->json(['success' => false, 'error' => $e->getMessage(), 'status' => 500]);
}
}
/**
* Created By : sayali parab
* Created at : 28 May 2024
* Use : To delete.
*/
public function delete_newsarticle($id)
{
@@ -157,6 +180,12 @@ public function delete_newsarticle($id)
}
}
/**
* Created By : sayali parab
* Created at : 28 May 2024
* Use : To add.
*/
public function add()
{
$news_categories = NewsArticleCategory::all()->toArray();
@@ -196,6 +225,12 @@ public function delete_newsarticle($id)
// return response()->json(['success' => false, 'error' => $e->getMessage(), 'status' => 500]);
// }
// }
/**
* Created By : sayali parab
* Created at : 28 May 2024
* Use : To insert.
*/
public function insert(Request $request)
{
try {

View File

@@ -14,6 +14,11 @@ use Illuminate\Support\Facades\Auth;
class ManageProfileController extends Controller
{
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To get and update admin profile.
*/
public function index()
{

View File

@@ -8,6 +8,7 @@ use App\Models\PrivacyPolicy;
class PrivacyPolicyController extends Controller
{
// public function index(){
// return view('Admin.pages.manage_cms.manage_privacy.manage_privacy');
@@ -18,17 +19,32 @@ class PrivacyPolicyController extends Controller
// return view('Admin.pages.manage_cms.manage_privacy.manage_privacy');
// }
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To get privacy policy page.
*/
public function index(){
$view_privacy = PrivacyPolicy::get()->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy', compact('view_privacy'));
}
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To edit.
*/
public function edit($id){
$edit_privacy_policy = PrivacyPolicy::find($id)->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit', compact('edit_privacy_policy'));
}
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To update privacy policy page.
*/
public function update(Request $request)
{
$update = PrivacyPolicy::find($request->privacy_custom_id);
@@ -36,12 +52,22 @@ class PrivacyPolicyController extends Controller
$update->save();
return response()->json(['success' => true, 'status' => 200]);
}
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To edit rest.
*/
public function edit_rest($id)
{
$edit_privacy_policy_rest = PrivacyPolicy::find($id)->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit_rest', compact('edit_privacy_policy_rest'));
}
/**
* Created By : sayali parab
* Created at : 30 May 2024
* Use : To update rest.
*/
public function update_rest(Request $request)
{
$update = PrivacyPolicy::find($request->privacy_rest_id);

View File

@@ -21,7 +21,11 @@ class RestaurantAppController extends Controller
{
/**
* Created By : sayali parab
* Created at : 03 June 2024
* Use : To get restaturant user.
*/
public function index_restraunt_users(Request $request)
{
@@ -113,7 +117,11 @@ class RestaurantAppController extends Controller
// return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
// }
// }
/**
* Created By : sayali parab
* Created at : 03 June 2024
* Use : To change the status restaturant user.
*/
public function change_rest_user_status(Request $request)
{
try {
@@ -159,7 +167,11 @@ class RestaurantAppController extends Controller
/**
* Created By : sayali parab
* Created at : 03 June 2024
* Use : To view restaturant user.
*/
public function view_rest($id)
{
@@ -193,7 +205,11 @@ class RestaurantAppController extends Controller
/**
* Created By : sayali parab
* Created at : 03 June 2024
* Use : To edit restaturant user.
*/
public function edit_Restaurant($id)
{
@@ -262,6 +278,11 @@ class RestaurantAppController extends Controller
// }
// }
/**
* Created By : sayali parab
* Created at : 04 June 2024
* Use : To update restaturant user.
*/
public function updateRest(Request $request)
{
@@ -293,6 +314,11 @@ class RestaurantAppController extends Controller
}
}
/**
* Created By : sayali parab
* Created at : 04 June 2024
* Use : To delete restaturant user.
*/
public function deleteRestaurantsUsers($id)
{
@@ -312,7 +338,11 @@ class RestaurantAppController extends Controller
}
}
/**
* Created By : sayali parab
* Created at : 04 June 2024
* Use : To archieve restaturant user.
*/
public function archive_restaturant()
{
@@ -324,6 +354,13 @@ class RestaurantAppController extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/**
* Created By : sayali parab
* Created at : 04 June 2024
* Use : To unarchieve restaturant user.
*/
public function unarchive_rest($id)
{

View File

@@ -6,7 +6,7 @@ use App\Models\NotificationDetails;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
// use Ladumor\OneSignal\OneSignal;
use Ladumor\OneSignal\OneSignal;
class onesignalhelper

View File

@@ -10,7 +10,7 @@
"require": {
"php": "^8.2",
"barryvdh/laravel-dompdf": "^2.2",
"ladumor/one-signal": "*",
"ladumor/one-signal": "^1.0",
"laravel/framework": "^11.0",
"laravel/jetstream": "^5.1",
"laravel/sanctum": "^4.0",

View File

@@ -562,161 +562,280 @@
@endsection
@section('section_script')
<script>
$('#zero-config1').DataTable({
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
"<'table-responsive'tr>" +
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
"oLanguage": {
"oPaginate": {
"sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
},
"sInfo": "Showing page _PAGE_ of _PAGES_",
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
"sSearchPlaceholder": "Search...",
"sLengthMenu": "Results : _MENU_",
},
"stripeClasses": [],
"lengthMenu": [7, 10, 20, 50],
"pageLength": 10
});
document.addEventListener("DOMContentLoaded", function() {
// ------------ User chart starts ------------
// Data for the chart
var userChartData = [{
name: 'Line 1',
data: [30, 40, 85, 50, 39, 60, 70, 91, 125, 70, 50, 80]
},
{
name: 'Line 2',
data: [20, 35, 15, 55, 60, 100, 80, 95, 110, 50, 30, 40]
}
];
// Chart options
var userOptions = {
chart: {
type: 'line',
zoom: {
enabled: false // Disable Zoom and Pan
<script>
$('#zero-config').DataTable({
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
"<'table-responsive'tr>" +
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
"oLanguage": {
"oPaginate": {
"sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
},
toolbar: {
show: false // Hide the download button
}
"sInfo": "Showing page PAGE of _PAGES_",
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
"sSearchPlaceholder": "Search...",
"sLengthMenu": "Results : _MENU_",
},
series: userChartData,
xaxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov',
'Dec'
]
},
stroke: {
curve: 'smooth',
width: [4, 4]
}
};
"stripeClasses": [],
"lengthMenu": [7, 10, 20, 50],
"pageLength": 10
});
// Create the chart
var userChart = new ApexCharts(document.querySelector("#user-chart"), userOptions);
userChart.render();
// --------- User chart ends ------------
// --------- Sales chart starts ------------
var salesChartData = [{
name: 'Bar Line',
data: [30, 60, 35, 20, 49, 90, 70, 91, 125, 44, 47, 67]
}];
// Chart options
var salesOptions = {
chart: {
type: 'bar',
zoom: {
enabled: false // Disable Zoom and Pan
$('#zero-config2').DataTable({
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
"<'table-responsive'tr>" +
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
"oLanguage": {
"oPaginate": {
"sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
},
toolbar: {
show: false // Hide the download button
"sInfo": "Showing page PAGE of _PAGES_",
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
"sSearchPlaceholder": "Search...",
"sLengthMenu": "Results : _MENU_",
},
"stripeClasses": [],
"lengthMenu": [7, 10, 20, 50],
"pageLength": 10
});
$(document).ready(function() {
$('<button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);"class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-mid avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
.insertBefore("#zero-config_filter label");
$("#zero-config").on("click", ".sub_admin_permission", function() {
// $('.sub_admin_permission').on('click', function() {
var passportName = $(this).data('passport-name');
var passportPrice = $(this).data('price');
var passportId = $(this).data('passport-id');
var quantity = $(this).data('quantity');
var orderDate = $(this).data('orderdate');
var tansId = $(this).data('payment_id');
var paymentmode = $(this).data('paymentmode');
var formattedPrice = '$' + passportPrice;
$('.subadmin-option span').eq(0).text(passportName);
$('.subadmin-option span').eq(1).text(formattedPrice);
$('.subadmin-option span').eq(2).text(passportId);
$('.subadmin-option span').eq(3).text(quantity);
$('.subadmin-option span').eq(4).text(orderDate);
$('.subadmin-option span').eq(5).text(tansId);
$('.subadmin-option span').eq(6).text(paymentmode);
});
});
$(function(e) {
$("#select-all-ids").click(function() {
$(".form-check-input").prop('checked', $(this).prop('checked'));
});
$(".form-check-input").click(function() {
if (!$(this).prop('checked')) {
$("#select-all-ids").prop('checked', false);
} else {
if ($(".form-check-input:checked").length === $(".form-check-input").length) {
$("#select-all-ids").prop('checked', true);
}
}
},
series: salesChartData,
xaxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov',
'Dec'
]
},
plotOptions: {
bar: {
columnWidth: '30%' // Adjust the bar width as needed
});
$(document).on("click", "#download-selected", function(e) {
e.preventDefault();
var allIds = [];
// Iterate over each page of the DataTable
var table = $('#zero-config').DataTable();
for (var i = 0; i < table.page.info().pages; i++) {
table.page(i).draw(false); // Switch to page i
$('#zero-config tbody input:checked').each(function() {
allIds.push($(this).val());
});
}
},
dataLabels: {
enabled: false // Hide the values on the bars
if (allIds.length > 0) {
// If there are selected customers
$('#ids').prop('disabled', false);
$('#all_id').prop('disabled', true);
$('#ids').val(allIds);
// Now submit the form or perform download action
$('#customer-form').submit(); // Or perform your download action here
} else {
// No customers selected
toastr.error("Please select at least one customer to download.");
}
});
$(document).on("click", "#download_all", function(e) {
$('#all_id').prop('disabled', false);
$('#ids').prop('disabled', true);
})
});
$(document).on("click", ".more", function(e) {
e.preventDefault();
e.stopPropagation();
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Data for the chart
var userChartData = getUserChartData('monthly'); // Initial data
// Initial x-axis categories
var userCategories = getUserChartCategories('monthly');
// Chart options
var userOptions = {
chart: {
type: 'line',
zoom: {
enabled: false // Disable Zoom and Pan
},
toolbar: {
show: false // Hide the download button
}
},
series: userChartData,
xaxis: {
categories: userCategories
},
stroke: {
curve: 'smooth',
width: [4, 4]
}
};
// Create the chart
var userChart = new ApexCharts(document.querySelector("#user-chart"), userOptions);
userChart.render();
// Add event listener to the filter select element
document.getElementById('graph-filter').addEventListener('change', function(event) {
var selectedFilter = event.target.value;
userChartData = getUserChartData(selectedFilter); // Get data based on selected filter
userCategories = getUserChartCategories(selectedFilter); // Update x-axis categories
userChart.updateSeries(userChartData); // Update chart data
userChart.updateOptions({
xaxis: {
categories: userCategories
}
}); // Update chart options
});
// ------------ Sales chart starts ------------
// Data for the sales chart
var salesChartData = <?php echo json_encode(array_values($formattedDefaultData)); ?>;
// Chart options for the sales chart
var salesOptions = {
chart: {
type: 'bar',
zoom: {
enabled: false // Disable Zoom and Pan
},
toolbar: {
show: false // Hide the download button
}
},
series: [{
name: 'Bar Line',
data: salesChartData
}],
xaxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov',
'Dec'
]
},
plotOptions: {
bar: {
columnWidth: '30%' // Adjust the bar width as needed
}
},
dataLabels: {
enabled: false // Hide the values on the bars
}
};
// Create the chart with default data
var salesChart = new ApexCharts(document.querySelector("#sales-chart"), salesOptions);
salesChart.render();
// Set default selected option to 'monthly' and trigger change event
$('#sales-chart-options').val('monthly').trigger('change');
// Event listener for select change
// Event listener for select change
});
// Function to fetch data based on selected filter
function getUserChartData(filter) {
switch (filter) {
case 'monthly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataMonthlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataMonthlyWithType4)); ?>
}
];
case 'quarterly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataQuarterlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataQuarterlyWithType4)); ?>
}
];
case 'yearly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataYearlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataYearlyWithType4)); ?>
}
];
default:
return [];
}
};
// Create the chart
var salesChart = new ApexCharts(document.querySelector("#sales-chart"), salesOptions);
salesChart.render();
// --------- Sales chart ends ------------
});
// Add event listener to the filter select element
document.getElementById('graph-filter').addEventListener('change', function(event) {
var selectedFilter = event.target.value;
userChartData = getUserChartData(selectedFilter); // Get data based on selected filter
userCategories = getUserChartCategories(selectedFilter); // Update x-axis categories
userChart.updateSeries(userChartData); // Update chart data
userChart.updateOptions({
xaxis: {
categories: userCategories
}
}); // Update chart options
});
// Function to fetch data based on selected filter
function getUserChartData(filter) {
switch (filter) {
case 'monthly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataMonthlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataMonthlyWithType4)); ?>
}
];
case 'quarterly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataQuarterlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataQuarterlyWithType4)); ?>
}
];
case 'yearly':
return [{
name: 'Customer',
data: <?php echo json_encode(array_values($dataYearlyWithType3)); ?>
},
{
name: 'Restaurant',
data: <?php echo json_encode(array_values($dataYearlyWithType4)); ?>
}
];
default:
return [];
}
}
</script>
// Function to get x-axis categories based on selected filter
function getUserChartCategories(filter) {
switch (filter) {
case 'monthly':
return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'
];
case 'quarterly':
return ['Q1', 'Q2', 'Q3', 'Q4'];
case 'yearly':
return <?php echo json_encode(array_keys($dataYearlyWithType3)); ?>;
default:
return [];
}
}
</script>
@endsection

View File

@@ -50,6 +50,6 @@ Route::middleware(['restaurantApiBasicAuth'])->group(function () {
// //*******************************************************notification********************************************************
Route::get('/v1/get-notification', [RestNotificationController::class, 'getRestNotificationApi']);
Route::post('/v1/send-notification', [RestNotificationController::class, 'sendRestNotificationApi']);
// Route::post('/v1/alert-notification', [RestNotificationController::class, 'sendAlertNotificationApi']);
Route::post('/v1/alert-notification', [RestNotificationController::class, 'sendAlertNotificationApi']);
});
});