<?php
use App\Helper\frontend\Servicecats;
use App\Http\Controllers\Admin\BioController;
use App\Http\Controllers\Admin\Dashboard\DashboardController;
use App\Http\Controllers\Admin\HomeController;
use App\Http\Controllers\Admin\LogoController;
use App\Http\Controllers\Admin\Profile\ProfileController;
use App\Http\Controllers\Admin\ContactinfoController;
use App\Http\Controllers\Admin\BlogController;
use App\Http\Controllers\Admin\AboutsectionController;
use App\Http\Controllers\Admin\ServicesController;
use App\Http\Controllers\Admin\TestimonialController;
use App\Http\Controllers\Admin\TreatmentController;
use App\Http\Controllers\Admin\SocialController;
use App\Http\Controllers\Admin\NewsCategoryController;
use App\Http\Controllers\Admin\NewsController;
use App\Http\Controllers\FaqController;
use App\Models\Newscategory;
use Illuminate\Support\Facades\Route;

Route::group(['as' => 'admin::', 'prefix' => 'v1/cpanel/admin', 'middleware' => ['web', 'AdminMiddleware', 'revalidate']], function () {
    Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard');
    /*** Profile Routes Start ***/
    Route::get('/profile/{name}', [ProfileController::class, 'profile'])->name('profile');
    Route::post('/profile-update', [ProfileController::class, 'profile_update'])->name('profile_update');
    Route::post('/password-update', [ProfileController::class, 'password_update'])->name('password_update');
    Route::get('/admin-logout', [ProfileController::class, 'admin_logout'])->name('admin_logout');
    /*** Profile Routes End ***/


 /** Home Page **/

 Route::get('show-banner',[HomeController::class,'showbanner'])->name('show_banner');
 Route::get('add-banner',[HomeController::class,'addbanner'])->name('add_banner');
 Route::get('edit-banner/{id}',[HomeController::class,'editbanner'])->name('edit_banner');
 Route::post('update-banner/{id}',[HomeController::class,'updatebanner'])->name('update_banner');
 Route::post('save-banner',[HomeController::class,'savebanner'])->name('save_banner');
  Route::get('/delete-banner/{id}',[HomeController::class,'deletebanner'])->name('delete_banner');

 /** Home Page **/

 // Product Category //
 Route::get('product-maincategory',[HomeController::class,'maincategory'])->name('product_maincategory');
 Route::get('/add-product-maincategory',[HomeController::class,'addmaincategory'])->name('add_product_maincategory');
 Route::post('/save-product-maincategory',[HomeController::class,'savecategory'])->name('save_product_maincategory');
 Route::get('/delete-product-maincategory/{id}',[HomeController::class,'deletecategory'])->name('delete_product_maincategory');
 // Product Category //

 // Product SubCategory //

 Route::get('product-subcategory',[HomeController::class,'subcategory'])->name('product_subcategory');
 Route::get('/add-product-subcategory',[HomeController::class,'addsubcategory'])->name('add_product_subcategory');
 Route::post('/save-product-subcategory',[HomeController::class,'savesubcategory'])->name('save_product_subcategory');
 Route::get('/delete-product-subcategory/{id}',[HomeController::class,'deletesubcategory'])->name('delete_product_subcategory');

// Product SubCategory //

 // Product ChildCategory //

 Route::get('product-childcategory',[HomeController::class,'childcategory'])->name('product_childcategory');
 Route::get('/add-product-childcategory',[HomeController::class,'addchildcategory'])->name('add_product_childcategory');
 Route::post('/save-product-childcategory',[HomeController::class,'savechildcategory'])->name('save_product_childcategory');
 Route::delete('/delete-product-subcategory/{id}', [HomeController::class, 'deletechildcategory'])
 ->name('admin::delete_product_subcategory');
 Route::get('get-subcategories', [HomeController::class, 'getSubcategories'])->name('get_subcategories');
 // Product ChildCategory //

// Products  //

Route::get('show-products',[HomeController::class,'showproduct'])->name('show_product');
Route::get('/add-product',[HomeController::class,'addproduct'])->name('add_product');
Route::get('get-subcategorieslist', [HomeController::class, 'getSubcategorieslist'])->name('getSubcategorieslist');

Route::get('/edit-product/{id}',[HomeController::class,'editproduct'])->name('edit_product');

Route::post('/update-product/{id}',[HomeController::class,'updateproduct'])->name('update_product');


Route::get('/admin/get-childcategories', [HomeController::class, 'getChildcategorieslist'])->name('getChildcategorieslist');

Route::post('/save-product',[HomeController::class,'saveproduct'])->name('save_product');

Route::get('/delete-product/{id}',[HomeController::class,'deleteproduct'])->name('delete_product');

Route::get('add-product-page-detail-images/{id}',[HomeController::class,'productimages'])->name('add_product_images');
Route::post('save-product-page-detail-images/{id}',[HomeController::class,'saveproductimages'])->name('save_details_image');





// Products //


Route::get('/order-details',[HomeController::class,'orderdetails'])->name('order_details');

Route::get('/order-details-product/{id}',[HomeController::class,'orderdetailsproduct'])->name('order_details_product');




///////////////////////////////////////////////////////////////////////////////////////////












    /** news Category **/

   Route::get('/news-category',[NewsCategoryController::class,'category'])->name('news_category');
   Route::get('/add-news-category',[NewsCategoryController::class,'addcategory'])->name('add_news_category');
   Route::post('/save-news-category',[NewsCategoryController::class,'savecategory'])->name('save_news_category');
   Route::get('/delete-news-mcat/{id}',[NewsCategoryController::class,'deletenewscat'])->name('delete_news_mcat');

    /** end news Category **/

 /** news SubCategory **/
   Route::get('/news-subcategory',[NewsCategoryController::class,'subcategory'])->name('news_subcategory');
   Route::get('/add-news-subcategory',[NewsCategoryController::class,'addsubcategory'])->name('add_news_subcategory');
   Route::post('/save-news-subcategory',[NewsCategoryController::class,'savesubcategory'])->name('save_news_subcategory');
   Route::get('/delete-news-subcat/{id}',[NewsCategoryController::class,'deletesubcat'])->name('dalete_news_subcat');

 /** end news SubCategory **/

/** news **/
Route::get('/show-news',[NewsController::class,'shownews'])->name('show_news');
Route::get('/add-news',[NewsController::class,'addnews'])->name('add_news');

Route::post('/save-news',[NewsController::class,'savenews'])->name('save_news');
Route::get('/edit-news/{id}',[NewsController::class,'editnews'])->name('edit_news');
Route::post('/update-news/{id}',[NewsController::class,'updatenews'])->name('update_news');
Route::get('/delete-news/{id}',[NewsController::class,'deletenews'])->name('delete_news');



Route::get('/livelink',[NewsController::class,'livelink'])->name('show_live_link');
Route::get('/edit-livelink/{id}',[NewsController::class,'editlivelink'])->name('edit_livelink');
Route::post('/update-livelink/{id}',[NewsController::class,'updatelivelink'])->name('update_livelink');

/** news **/

/** news Video **/
Route::get('/show-news-video',[NewsController::class,'showvideonews'])->name('show_news_videos');
Route::get('/add-news-video',[NewsController::class,'addnewsvideo'])->name('add_news_video');
Route::post('/save-news-video',[NewsController::class,'savenewsvideo'])->name('save_news_video');
Route::get('/delete-news-video/{id}',[NewsController::class,'deletenewsvideo'])->name('delete_news_video');
/** news Video **/

/**Breaking news **/

Route::get('/show-breaking-news',[NewsController::class,'showbreakingnews'])->name('show_breaking_news');
Route::get('/add-breaking-news',[NewsController::class,'addbreakingnews'])->name('add_news_breaking');
Route::post('/save-breaking-news',[NewsController::class,'savebreakingnews'])->name('save_breaking_news');

Route::get('/edit-breaking-news/{id}',[NewsController::class,'editbreakingnews'])->name('edit_breaking_news');
Route::post('/update-breaking-news/{id}',[NewsController::class,'updatebreakingnews'])->name('update_breaking_news');
Route::get('/delete-breaking-news/{id}',[NewsController::class,'deletebreakingnews'])->name('delete_breaking_news');

/**Breaking news **/



/**Latest news **/

Route::get('/show-latest-news',[NewsController::class,'showlatestnews'])->name('show_latest_news');
Route::get('/add-latest-news',[NewsController::class,'addlatestnews'])->name('add_news_latest');
Route::post('/save-latest-news',[NewsController::class,'savelatestnews'])->name('save_latest_news');

Route::get('/edit-latest-news/{id}',[NewsController::class,'editlatestnews'])->name('edit_latest_news');
Route::post('/update-latest-news/{id}',[NewsController::class,'updatelatestnews'])->name('update_latest_news');
Route::get('/delete-latest-news/{id}',[NewsController::class,'deletelatestnews'])->name('delete_latest_news');

/**Latest news **/




/** news E Papers**/
Route::get('/view-e-paper',[NewsController::class,'viewepaper'])->name('view_epapers');
Route::get('/e-paper',[NewsController::class,'epaper'])->name('epapers');
Route::post('/save-epaper',[NewsController::class,'saveepaper'])->name('save_epaper');
Route::get('/delete-epaper/{id}',[NewsController::class,'deleteepaper'])->name('delete_epaper');

/** news E Papers **/









    ////////////////////////////////////////////////////

    /** Contact info **/

    Route::get('contact-info',[ContactInfoController::class,'index'])->name('contact_info');
    Route::get('edit-contactinfo/{id}',[ContactInfoController::class,'edit'])->name('edit_contactinfo');
    Route::post('update-contactinfo/{id}',[ContactInfoController::class,'update'])->name('update_contact_info');

    Route::get('show-contact-form',[ContactInfoController::class,'showformdata'])->name('show_contact_form');
    Route::get('delete-contact-form/{id}',[ContactInfoController::class,'deletedata'])->name('delete_contact_form');

    /** Contact info **/


    /** Testimonials **/

    Route::get('show-testimonials',[TestimonialController::class,'show'])->name('testimonials_page');
    Route::get('add-testimonials',[TestimonialController::class,'add'])->name('add_testimonials');
    Route::post('save-testimonials',[TestimonialController::class,'save'])->name('save_testimonials');
    Route::get('edit-testimonials/{id}',[TestimonialController::class,'edit'])->name('edit_testimonials');
    Route::post('update-testimonials/{id}',[TestimonialController::class,'update'])->name('update_testimonials');
    Route::get('delete-testimonials/{id}',[TestimonialController::class,'delete'])->name('delete_testimonials');

    
    /** Testimonials **/


     /** Blog **/
    Route::get('/blog', [BlogController::class,'blog'])->name('blog_page');
    Route::get('add-blog', [BlogController::class, 'add'])->name('add_blog');
    Route::post('/save-blog', [BlogController::class, 'save'])->name('save_blogmain');
    Route::get('/edit-blog/{id}', [BlogController::class, 'edit'])->name('edit_blog');
    Route::post('/update-blog/{id}', [BlogController::class, 'update'])->name('update_blog');
    Route::get('/delete-blog/{id}', [BlogController::class, 'delete'])->name('delete_blog');

     /** Blog **/


     /** Services **/

     Route::get('show-services',[ServicesController::class,'show'])->name('show_services');
     Route::get('add-services',[ServicesController::class,'add'])->name('add_services');
     Route::post('save-services',[ServicesController::class,'save'])->name('save_services');
     Route::get('edit-services/{id}',[ServicesController::class,'edit'])->name('edit_services');
     Route::post('update-services/{id}',[ServicesController::class,'update'])->name('update_services');
     Route::get('delete-services/{id}',[ServicesController::class,'delete'])->name('delete_services');

     /** Services **/
     
     
     
     
     
     /**Other Services **/

     Route::get('show-otherservices',[ServicesController::class,'othershow'])->name('show_otherservices');
     Route::get('add-otherservices',[ServicesController::class,'otheradd'])->name('add_otherservices');
     Route::post('save-otherservices',[ServicesController::class,'othersave'])->name('save_otherservices');
     Route::get('edit-otherservices/{id}',[ServicesController::class,'otheredit'])->name('edit_otherservices');
     Route::post('update-otherservices/{id}',[ServicesController::class,'otherupdate'])->name('update_otherservices');
     Route::get('delete-otherservices/{id}',[ServicesController::class,'otherdelete'])->name('delete_otherservices');

     /**Other Services **/
     
     
     
     
     

     Route::get('show-privacy',[ServicesController::class,'privacy'])->name('privacy');
     Route::get('edit-privacy/{id}',[ServicesController::class,'editprivacy'])->name('edit_privacy');
     Route::post('update-privacy/{id}',[ServicesController::class,'updateprivacy'])->name('update_privacy');



     Route::get('show-refund',[ServicesController::class,'refund'])->name('refund');
     Route::get('edit-refund/{id}',[ServicesController::class,'editrefund'])->name('edit_refund');
     Route::post('update-refund/{id}',[ServicesController::class,'updaterefund'])->name('update_refund');  



     Route::get('show-return',[ServicesController::class,'return'])->name('return');
     Route::get('edit-return/{id}',[ServicesController::class,'editreturn'])->name('edit_return');
     Route::post('update-return/{id}',[ServicesController::class,'updatereturn'])->name('update_return'); 



     
     Route::get('show-horoscope',[ServicesController::class,'horoscope'])->name('horoscope');
     Route::get('edit-horoscope/{id}',[ServicesController::class,'edithoroscope'])->name('edit_horoscope');
     Route::post('update-horoscope/{id}',[ServicesController::class,'updatehoroscope'])->name('update_horoscope');

     Route::get('addhoroscope',[ServicesController::class,'addhoroscope'])->name('addhoroscope');
     Route::post('savehoroscope',[ServicesController::class,'savehoroscope'])->name('save_horoscope');

     Route::get('horoscopelist',[ServicesController::class,'horoscopelist'])->name('show_horoscopelist');
     Route::get('edit-horoscopelist/{id}',[ServicesController::class,'edithoroscopelist'])->name('edit_horoscopelist');
     Route::post('update-horoscopelist/{id}',[ServicesController::class,'updatehoroscopelist'])->name('update_horoscopelist');



     Route::get('show-terms',[ServicesController::class,'terms'])->name('terms');
     Route::get('edit-terms/{id}',[ServicesController::class,'editterms'])->name('edit_terms');
     Route::post('update-terms/{id}',[ServicesController::class,'updateterms'])->name('update_terms');


     Route::get('disclaimer',[ServicesController::class,'disclaimer'])->name('disclaimer');
     Route::get('edit-disclaimer/{id}',[ServicesController::class,'editdisclaimer'])->name('edit_disclaimer');
     Route::post('update-disclaimer/{id}',[ServicesController::class,'updatedisclaimer'])->name('update_disclaimer');
    
     Route::get('advertise',[ServicesController::class,'advertise'])->name('advertise');
     Route::get('edit-advertise/{id}',[ServicesController::class,'editadvertise'])->name('edit_advertise');
     Route::post('update-advertise/{id}',[ServicesController::class,'updateadvertise'])->name('update_advertise');

     /** Home Page **/

    Route::get('show-banner',[HomeController::class,'showbanner'])->name('show_banner');
    Route::get('edit-banner/{id}',[HomeController::class,'editbanner'])->name('edit_banner');
    Route::post('update-banner/{id}',[HomeController::class,'updatebanner'])->name('update_banner');


    Route::get('home-about',[HomeController::class,'homeabout'])->name('home_about');
    Route::get('edit-home-about/{id}',[HomeController::class,'edithomeabout'])->name('edit_home_about');
    Route::post('update-home-about/{id}',[HomeController::class,'updatehomeabout'])->name('update_home_about');


    Route::get('view-home-form-data',[HomeController::class,'formdata'])->name('home_form_data');
    Route::get('delete-home-form-data/{id}',[HomeController::class,'deleteformdata'])->name('delete_home_form_data');

     /**  Home Page  **/


     /**  About Page  **/

     Route::get('view-treatment-photos',[TreatmentController::class,'viewphoto'])->name('view_treatment_photos');
     Route::get('add-treatment-photos',[TreatmentController::class,'addphoto'])->name('add_treatment_photos');
     Route::post('save-treatment-photos',[TreatmentController::class,'savephoto'])->name('save_treatment_photos');
     Route::get('delete-treatment-photos/{id}',[TreatmentController::class,'deletephoto'])->name('delete_treatment_photos');



     Route::get('show-about-section',[AboutsectionController::class,'showabout'])->name('show_about');
     Route::get('edit-about-section/{id}',[AboutsectionController::class,'editabout'])->name('edit_about');
     Route::post('update-about-section/{id}',[AboutsectionController::class,'updateabout'])->name('update_about');



     Route::get('show-bio-section',[BioController::class,'showbio'])->name('show_bio');
     Route::get('edit-bio-section/{id}',[BioController::class,'editbio'])->name('edit_bio');
     Route::post('update-bio-section/{id}',[BioController::class,'updatebio'])->name('update_bio');

     /**  About Page  **/


     /*** Site social Start ***/
     Route::get('/social', [SocialController::class, 'index'])->name('social');
     Route::get('/social-edit/{id}', [SocialController::class, 'edit'])->name('social_edit');
     Route::post('/social-update/{id}', [SocialController::class, 'update'])->name('social_update');
     /*** Site social End ***/


      /**  Logo  **/

      Route::get('logo',[LogoController::class,'index'])->name('logo_page');

      Route::get('edit-logo/{id}',[LogoController::class,'edit'])->name('edit_logo_page');
      Route::post('update-logo/{id}',[LogoController::class,'updatelogo'])->name('update_logo');

       /**  Logo  **/


       Route::get('faq', [FaqController::class,'faqquestion'])->name('faqquestion_home');
       Route::get('add-faq', [FaqController::class,'add_faqs'])->name('add_faq');
    Route::post('save-faq',[FaqController::class,'save_faq'])->name('save_faq');
    Route::get('edit-faq/{id}',[FaqController::class,'edit'])->name('edit_faq');
    Route::post('update-faq/{id}',[FaqController::class,'update'])->name('update_faq');
    Route::get('delete-faq/{id}',[FaqController::class,'delete'])->name('delete_faq');

  

       
    
});
