<?php
use App\Http\Controllers\OrganizationController;
use App\Http\Controllers\ProfileController; 
use App\Http\Controllers\ActivityController;
use App\Http\Controllers\GrantsController; 
use App\Http\Controllers\donationsController; 
use App\Http\Controllers\ReportController;
use App\Http\Controllers\AdministrationsController; 
use App\Http\Controllers\ManagerController; 




use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController; 
use App\Http\Controllers\ProjectController;
use App\Http\Controllers\PlatformController; 


Route::get('/', function () {
    return view('welcome');
});

    // https://www.who.int/data/gho/info/gho-odata-api

Route::get('/ai-summary', [ReportController::class, 'summary']);

 Route::get('/home', [HomeController::class, 'index'])->name('home');

 Route::get('/dashboardX', [HomeController::class, 'index'])->name('home');
Route::get('/news', [HomeController::class, 'news'])->name('news');
Route::get('/announcements', [HomeController::class, 'announcements'])->name('announcements');
Route::get('/activities', [HomeController::class, 'activities'])->name('activities');
Route::get('/services', [HomeController::class, 'services'])->name('services');
Route::get('/states', [HomeController::class, 'states'])->name('states');

Route::get('/', [PlatformController::class, 'index'])->name('/');


      
 Route::get('/dashboard', [HomeController::class, 'Homeindex'])->name('dashboard');
//Route::get('/dashboard', function ())->middleware(['auth', 'verified'])->name('dashboard');

Route::middleware('auth')->group(function () { 
    //===================================donations==================================================
    Route::prefix('Manager/')->as('Manager.')->group(function () {
        Route::get('create', [ManagerController::class, 'create'])->name('create');
        Route::get('userdata', [ManagerController::class, 'getuserData'])->name('userdata');
        Route::get('Delete-User', [ManagerController::class, 'Delete_User'])->name('Delete-User');

       


 });
//===============================================================================================

    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
//===================================projects==================================================
    Route::prefix('projects/')->as('projects.')->group(function () {
        Route::get('create', [ProjectController::class, 'create'])->name('create');
        Route::post('store', [ProjectController::class, 'store'])->name('store');
        Route::get('index', [ProjectController::class, 'index'])->name('index');
        Route::post('Requirement/store', [ProjectController::class, 'Requirement_store'])->name('Requirement.store');

        Route::get('data', [ProjectController::class, 'getData'])->name('data');
        Route::get('show-Project/{Project_id}', [ProjectController::class, 'show_Project'])->name('show-Project');
        
  Route::get('dataadmin', [ProjectController::class, 'getDataadmin'])->name('dataadmin');



        Route::get('Delete-Need/{Project_id}', [ProjectController::class, 'Delete_Need'])->name('Delete-Need');
 
        Route::get('NeedprojectData/{Project_id}', [ProjectController::class, 'getNeedprojectData'])->name('NeedprojectData');
        Route::get('Send-projects/{Project_id}', [ProjectController::class, 'Send_projects'])->name('Send-projects');
        Route::post('Save-Review-projects', [ProjectController::class, 'saveReviewProjects'])->name('Save-Review-projects');
        Route::post('UploadRequirmentDocument', [ProjectController::class, 'uploadRequirementDocument'])->name('UploadRequirmentDocument');
       // Route::post('DeleteRequirementDocument', [ProjectController::class, 'DeleteRequirementDocument'])->name('DeleteRequirementDocument');
        Route::delete('files/{id}', [ProjectController::class, 'destroyRequirementDocument'])->name('files.destroy');

       // Route::get('data', [ProjectController::class, 'getData'])->name('data');
        Route::get('{countories}', [ProjectController::class, 'edit'])->name('UpdateTaks');
        Route::put('{countories}', [ProjectController::class, 'update'])->name('UpdateTaks');
        Route::delete('{countories}', [ProjectController::class, 'destroy'])->name('delete');
    });        Route::get('data', [ProjectController::class, 'getData'])->name('data');

//===============================================================================================

//===================================grant==================================================
    Route::prefix('grant/')->as('grant.')->group(function () {
        Route::get('create', [GrantsController::class, 'create'])->name('create');
        Route::post('store', [GrantsController::class, 'store'])->name('store');
        Route::get('index', [GrantsController::class, 'index'])->name('index');

        Route::get('data', [GrantsController::class, 'getData'])->name('data');
        Route::get('show-Project/{Project_id}', [GrantsController::class, 'show_Project'])->name('show-Project');
      
                      
    
        Route::get('report', [GrantsController::class, 'report'])->name('report');



     });
//===============================================================================================


//===================================donations==================================================
    Route::prefix('donations/')->as('donations.')->group(function () {
        Route::get('create', [donationsController::class, 'create'])->name('create');
        Route::post('store', [donationsController::class, 'store'])->name('store');
        Route::get('index', [donationsController::class, 'index'])->name('index');

        Route::get('data', [donationsController::class, 'getData'])->name('data');
        Route::get('show-Project/{Project_id}', [donationsController::class, 'show_Project'])->name('show-Project');
 
        Route::get('report', [donationsController::class, 'report'])->name('report');


 });
//===============================================================================================


//===================================activity==================================================
    Route::prefix('activity/')->as('activity.')->group(function () {
        Route::get('create/{Project_id}', [ActivityController::class, 'create'])->name('create');
        Route::post('store', [ActivityController::class, 'store'])->name('store');
        Route::get('index', [ActivityController::class, 'index'])->name('index');

        Route::get('data', [ActivityController::class, 'getActivityData'])->name('data');
        Route::get('ActivityprojectData/{Project_id}', [ActivityController::class, 'getActivityprojectData'])->name('ActivityprojectData');
        Route::get('show-Project/{Project_id}', [ActivityController::class, 'show_Project'])->name('show-Project');
        Route::post('Location', [ActivityController::class, 'Activity_Location'])->name('Location');
        Route::get('projectData', [ActivityController::class, 'getData'])->name('projectData');
        Route::get('Taskdata', [ActivityController::class, 'getTaskdata'])->name('Taskdata');
        Route::delete('tasks-Delete/{task_id}', [ActivityController::class, 'Delete_Task'])->name('tasks-Delete');
        Route::get('show-Task-Activity/{activity_id}', [ActivityController::class, 'show_Task_Activity'])->name('show-Task-Activity');

         Route::post('Tasks-store', [ActivityController::class, 'Tasks_store'])->name('Tasks-store');
 



        Route::get('{countories}', [ActivityController::class, 'edit'])->name('UpdateTaks');
        Route::put('{countories}', [ActivityController::class, 'update'])->name('UpdateTaks');
        Route::delete('{countories}', [ActivityController::class, 'destroy'])->name('delete');
    });
//===============================================================================================
    
});




/*
 Route::prefix('organizations/')->as('organizations.')->group(function () {
        Route::get('Create', [countrycontroller::class, 'create'])->name('create');
        Route::post('store', [countrycontroller::class, 'store'])->name('store');
        Route::get('index', [countrycontroller::class, 'index'])->name('index');
        Route::get('{countories}', [countrycontroller::class, 'edit'])->name('UpdateTaks');
        Route::put('{countories}', [countrycontroller::class, 'update'])->name('UpdateTaks');
        Route::delete('{countories}', [countrycontroller::class, 'destroy'])->name('delete');
    });

       Route::middleware(['role:user'])->group(function () {
    Route::get('/User/dashboard', [OrganizationController::class, 'indexpageuser']);
  
});

Route::middleware(['role:admin'])->group(function () {
    Route::get('/Admin/dashboard', [OrganizationController::class, 'indexpage']);
  
});
*/



Route::get('organizations', [OrganizationController::class, 'create'])->name('organizations.create');
Route::post('organizations.store', [OrganizationController::class, 'store'])->name('organizations.store');

Route::get('Administrations', [AdministrationsController::class, 'create'])->name('Administrations.create');
Route::post('Administrations.store', [AdministrationsController::class, 'store'])->name('Administrations.store');


require __DIR__.'/auth.php';
