donation/app/Config/Routes.php
2024-07-10 11:17:52 +00:00

153 lines
7.6 KiB
PHP

<?php
namespace Config;
// Create a new instance of our RouteCollection class.
$routes = Services::routes();
/*
* --------------------------------------------------------------------
* Router Setup
* --------------------------------------------------------------------
*/
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Authentication');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
// The Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps
// where controller filters or CSRF protection are bypassed.
// If you don't want to define all routes, please use the Auto Routing (Improved).
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
// $routes->setAutoRoute(false);
/*
* --------------------------------------------------------------------
* Route Definitions
* --------------------------------------------------------------------
*/
// We get a performance increase by specifying the default
// route since we don't have to scan directories.
// In your routes file (e.g., app/Config/Routes.php)
# Authentication Routes
$routes->get('/', 'Authentication::index');
$routes->get('login/', 'Authentication::index');
$routes->post('authenticate/', 'Authentication::authenticate');//Routes For Authentication.
$routes->get('logout/', 'Authentication::logout');
$routes->post('auth_confirm_mail/', 'Authentication::auth_confirm_mail');//Routes For Confirmation Mail alert page.
$routes->get('auth_reset_password/', 'Authentication::auth_reset_password');//Routes For Load Reset password Page.
$routes->post('auth_reset_password_save/', 'Authentication::auth_reset_password_save');//Routes For update the Resetted password.
$routes->get('lockscreen/', 'Authentication::lockscreen');
$routes->get('lock/', 'Authentication::lock');
$routes->post('unlock/', 'Authentication::unlock');
$routes->post('confirm_password/', 'Authentication::confirm_password');
$routes->post('change_password', 'Authentication::change_password');
# Dashboard Routes
$routes->get('dashboard/', 'Home::index');
$routes->post("check_existing/", "Home::check_existing/");
# Users Routes
$routes->get("user_list/", "Users::index");
$routes->get("user_page/(:any)/(:any)", "Users::user_page/$1/$2");
$routes->post("insert_users", "Users::insert_users");
$routes->get("delete_user/(:any)", "Users::delete_user/$1");
$routes->get("activate_user/(:any)", "Users::activate_user/$1");
$routes->get('users/get_branches/(:num)', 'Users::get_branches/$1');
# Causes Routes
$routes->get("causes_list/", "Books::index");
$routes->get("add_causes/(:any)", "Books::add_causes/$1");
$routes->post("insert_causes", "Books::insert_causes");
$routes->get("delete_causes/(:any)", "Books::delete_causes/$1");
#Organization Routes (also known as business)
$routes->get("org_list/", "Business::index");
$routes->get("new_org/(:any)", "Business::new_org/$1");
$routes->post("insert_org/", "Business::insert_org");
$routes->get("delete_org/(:any)", "Business::delete_org/$1");
$routes->get("activate_org/(:any)", "Business::activate_org/$1");
#Donor Routes (also known as contributor,customer)
$routes->get("Contributor_list/", "Customer::index");
$routes->get("new_Donor/(:any)", "Customer::new_Donor/$1");
$routes->get('Customer/getReceiptDetails/(:num)', 'Customer::getReceiptDetails/$1');
$routes->post("insert_donor", "Customer::insert_donor");
$routes->post("insert_ajaxdonor", "Customer::insert_ajaxdonor");
$routes->get("delete_donor/(:any)", "Customer::delete_donor/$1");
$routes->get("export_Donor", "Customer::export_donor");
$routes->post("import_Donor", "Customer::import_donor");
#Donor group Routes (renamed as contributor group : 20/03/2024)
$routes->get('contributor_group/', 'Customer::donor_group');
$routes->get('view_contributor_group/(:any)', 'Customer::view_donor_group/$1');
$routes->get('preview_contributor_group/(:any)', 'Customer::preview_donor_group/$1');
$routes->get('delete_contributor_group/(:any)', 'Customer::delete_donor_group/$1');
$routes->post("insert_contributor_group", "Customer::insert_donor_group");
#Campaign Routes (also known as Event)
$routes->get("campaign_list/", "Event::index");
$routes->get("new_campaign/(:any)", "Event::new_campaign/$1");
$routes->post("insert_event/", "Event::insert_event");
#Receipt Routes (also known as Invoice)
$routes->get("receipt_list/", "Invoice::index");
$routes->get("new_receipt/(:any)", "Invoice::new_receipt/$1");
$routes->post("donor_cash_success/", "Invoice::donor_cash_success");
$routes->post("donor_cash_delete/", "Invoice::donor_cash_delete");
$routes->get("donations_accepted/", "Invoice::donations_accepted");
$routes->post("save_donations_accepted/", "Invoice::save_donations_accepted");
$routes->get("audit_history", "Invoice::audit_history");
$routes->get('generate-pdf/(:num)', 'Invoice::generatePdf/$1');
$routes->get('Invoice/showInvoiceModal', 'Invoice::showInvoiceModal');
$routes->post("get_donor_details", "Invoice::get_donor_details");
$routes->post("save_invoice/", "Invoice::save_invoice/");
$routes->add('approve_invoice/(:num)', 'Invoice::approve_invoice/$1');
$routes->get('generate_invoice_pdf/(:num)', 'Invoice::generate_invoice_pdf/$1');
$routes->get("export_receipt", "Invoice::export_receipt");
$routes->post("import_receipt", "Invoice::import_receipt");
#Report Routes
$routes->match(['get','post'],'/general_inv_rp','Invoice::general_inv_rp');
$routes->match(['get','post'],'/mem_inv_rp','Invoice::general_membership_inv_rp');
$routes->match(['get','post'],'/itemwise_report','Invoice::itemwise_report');
# Notifications Routes
// $routes->get('controller/SubExpdetail/(:num)', 'YourController::SubExpdetail/$1');
$routes->cli("getExpCustomerDetail/(:num)",'Notifications::getExpCustomerDetail/$1');
$routes->get('send_whatsapp_message/', 'Notifications::send_whatsapp_message');
$routes->post('whatsapp_custom_notifications/', 'Notifications::whatsapp_custom_notifications');
$routes->match(['post', 'get'], 'mail_custom_notifications', 'Notifications::mail_custom_notifications');
// $routes->match(['post', 'get'], 'due_date_notifications', 'Notifications::due_date_notifications');
// $routes->get('due_date_notifications/(:any)', 'Notifications::due_date_notifications/$1');
$routes->get('due_date_notifications', 'Notifications::due_date_notifications');
$routes->get('template_creation/', 'Notifications::template_creation');
$routes->get('template_creation_form/(:any)', 'Notifications::template_creation_form/$1');
$routes->get('template_creation_delete/(:any)', 'Notifications::template_creation_delete/$1');
$routes->post("template_creation_insert", "Notifications::template_creation_insert");
$routes->get('campaign_creation/', 'Notifications::campaign_creation');
$routes->get('campaign_creation_form/(:any)', 'Notifications::campaign_creation_form/$1');
$routes->get('campaign_creation_delete/(:any)', 'Notifications::campaign_creation_delete/$1');
$routes->post("campaign_creation_insert", "Notifications::campaign_creation_insert");
/*
* --------------------------------------------------------------------
* Additional Routing
* --------------------------------------------------------------------
*
* There will often be times that you need additional routing and you
* need it to be able to override any defaults in this file. Environment
* based routes is one such time. require() additional route files here
* to make that happen.
*
* You will have access to the $routes object within that file without
* needing to reload it.
*/
if (is_file(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}