<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Auth::login');
$routes->post('/loginprocess', 'Auth::loginprocess');
$routes->post('/admin/dashboard', 'Auth::dashboard');
$routes->get('/admin/dashboard', 'Auth::dashboard');
// $routes->get('/admin', 'Auth::dashboard');
// $routes->get('/index.php/admin/dashboard', 'Auth::dashboard');

// CRM Routes
$routes->get('/admin/crmdashboard', 'Admin\crm::dashboard');
$routes->get('/admin/viewcustomer/(:num)', 'Admin\crm::viewcustomer/$1');
$routes->get('/admin/addcustomer', 'Admin\crm::addcustomer');
$routes->get('/admin/updatecustomer/(:num)', 'Admin\crm::updatecustomer/$1');
$routes->get('/admin/deletecustomer/(:num)', 'Admin\crm::deletecustomer/$1');

// CRM POST
$routes->post('/admin/addcustomer', 'Admin\crm::addcustomer');
$routes->post('admin/addcustomer/save', 'Admin\crm::save');
$routes->post('/admin/updatecustomer/save/(:num)', 'Admin\crm::save');


// Quotation
$routes->get('/admin/createquote', 'Admin\quote::createquote');
$routes->get('/admin/viewquotes', 'Admin\quote::viewquotes');
$routes->get('/admin/viewquote/(:num)', 'Admin\quote::viewquote/$1');

// Quotation Post
$routes->post('admin/savequote','Admin\quote::savequote');

// Invoices
$routes->get('/admin/createinvoice', 'Admin\invoices::createinvoice');
$routes->get('/admin/viewinvoices', 'Admin\invoices::viewinvoices');
$routes->get('/admin/viewsingleinvoice/(:num)', 'Admin\invoices::viewsingleinvoicebyid/$1');

// $routes->get('/admin/crmleads', 'Admin\crm::leads');
// $routes->get('/admin/crmsaleorders', 'Admin\crm::saleorders');
// $routes->get('/admin/crminvoices', 'Admin\crm::invoices');
// $routes->get('/admin/crmdeliverynotes', 'Admin\crm::deliverynotes');
// $routes->get('/admin/crmcustomerpayments', 'Admin\crm::customerpayments');
// $routes->get('/admin/crmcreditnotes', 'Admin\crm::creditnotes');
// $routes->get('/admin/crmfollowups', 'Admin\crm::followups');
// $routes->get('/admin/viewcustomer', 'Admin\crm::dashboard');