<?php
$homepage = 'pages/dashbaord/home.php';
$reHomepage = 'pages/resellers/dashboard/home.php';
if ($page == 'dashboard') {
    include $homepage;
} elseif ($page == 'user_create') {
    ($obj->userMenuePermission('user_create')) ? include 'pages/user/user_create.php' : include $homepage;
} elseif ($page == 'setting') {
    ($obj->userMenuePermission('setting')) ? include 'pages/setting/index.php' : include $homepage;
}elseif ($page == 'bsdbillingsetting') {
    ($obj->userMenuePermission('bsdbillingsetting')) ? include 'pages/bsdbillingsetting/index.php' : include $homepage;
} elseif ($page == 'bill_generate_summary') {
    include 'pages/myBill/bill_generate_summary.php';
} elseif ($page == 'user_view') {
    ($obj->userMenuePermission('user_view')) ? include 'pages/user/user_view.php' : include $homepage;
} elseif ($page == 'user_edit') {
    ($obj->userMenuePermission('user_edit')) ? include 'pages/user/user_edit.php' : include $homepage;
} elseif ($page == 'zone_view') {
    ($obj->userMenuePermission('zone_view')) ? include 'pages/others/zone_view.php' : include $homepage;
} elseif ($page == 'subzone_view') {
    ($obj->userMenuePermission('subzone_view')) ? include 'pages/others/subzone_view.php' : include $homepage;
} elseif ($page == 'destination_view') {
    ($obj->userMenuePermission('destination_view')) ? include 'pages/others/destination_view.php' : include $homepage;
} elseif ($page == 'package_view') {
    ($obj->userMenuePermission('package_view')) ? include 'pages/others/package_view.php' : include $homepage;
} elseif ($page == 'customer_create') {
    ($obj->userMenuePermission('customer_create')) ? include 'pages/customer/customer_create.php' : include $homepage;
} elseif ($page == 'customer_view') {
    ($obj->userMenuePermission('customer_view')) ? include 'pages/customer/customer_view.php' : include $homepage;
}
elseif ($page == 'cus_info') {
    ($obj->userMenuePermission('cus_info')) ? include 'pages/customer/customer_info.php' : include $homepage;
}
elseif ($page == 'monthly_inactive_customer') {
    ($obj->userMenuePermission('monthly_inactive_customer')) ? include 'pages/customer/monthly_inactive_customer.php' : include $homepage;
}
elseif ($page == 'bulk_zone') {
    ($obj->userMenuePermission('bulk_zone')) ? include 'pages/customer/bulk_zone.php' : include $homepage;
} elseif ($page == 'running_month_customers') {
    ($obj->userMenuePermission('customer_view')) ? include 'pages/customer/running_month_customer_view.php' : include $homepage;
} elseif ($page == 'customer_delete_log') {
    ($obj->userMenuePermission('customer_delete_log')) ? include 'pages/customer/customer_delete_log.php' : include $homepage;
} elseif ($page == 'customer_edit') {
    ($obj->userMenuePermission('customer_edit')) ? include 'pages/customer/customer_edit.php' : include $homepage;
} elseif ($page == 'customer_ledger') {
    ($obj->userMenuePermission('customer_ledger')) ? include 'pages/customer/customer_ledger.php' : include $homepage;
} elseif ($page == 'billcollection_view') {
    ($obj->userMenuePermission('billcollection_view')) ? include 'pages/billcollection/billcollection_view.php' : include $homepage;
} elseif ($page == 'running_month_paid') {
    ($obj->userMenuePermission('all_paid')) ? include 'pages/billcollection/running_month_paid.php' : include $homepage;
} elseif ($page == 'all_paid') {
    ($obj->userMenuePermission('all_paid')) ? include 'pages/billcollection/bill_paid.php' : include $homepage;
} elseif ($page == 'previous_due') {
    ($obj->userMenuePermission('previous_due')) ? include 'pages/billcollection/previous_due.php' : include $homepage;
}elseif ($page == 'bill_not_generated') {
    ($obj->userMenuePermission('bill_not_generated')) ? include 'pages/billcollection/bill_not_generated_view.php' : include $homepage;
} elseif ($page == 'accounts_statement') {
    ($obj->userMenuePermission('accounts_statement')) ? include 'pages/statement/accounts_statement.php' : include $homepage;
} elseif ($page == 'brtcreport') {
    ($obj->userMenuePermission('brtcreport')) ? include 'pages/statement/brtcreport.php' : include $homepage;
} elseif ($page == 'mikrotik_connection') {
    ($obj->userMenuePermission('mikrotik_connection')) ? include 'pages/mikrotik/connect.php' : include $homepage;
}
elseif ($page == 'mikrotik_offline') {
    ($obj->userMenuePermission('mikrotik_offline')) ? include 'pages/mikrotik/offline.php' : include $homepage;
}
elseif ($page == 'customer_online_info') {
    ($obj->userMenuePermission('mikrotik_online_secret')) ? include 'pages/mikrotik/customer_online_info.php' : include $homepage;
}elseif ($page == 'customer_live_speed') {
    ($obj->userMenuePermission('customer_live_speed')) ? include 'pages/mikrotik/customer_live_speed.php' : include $homepage;
}
elseif ($page == 'mikrotik_online_secret') {
    ($obj->userMenuePermission('mikrotik_online_secret')) ? include 'pages/mikrotik/online_secret_list.php' : include $homepage;
}
elseif ($page == 'disconnect_by_due_cus') {
    ($obj->userMenuePermission('disconnect_by_due_cus')) ? include 'pages/mikrotik/disconnect_by_due_cus.php' : include $homepage;
}
elseif ($page == 'mikrotik_all_secret') {
    ($obj->userMenuePermission('mikrotik_all_secret')) ? include 'pages/mikrotik/all_secret_list.php' : include $homepage;
} elseif ($page == 'mikrotik_static_list') {
    ($obj->userMenuePermission('mikrotik_unmatching_secret')) ? include 'pages/mikrotik/static_secret_list.php' : include $homepage;
} elseif ($page == 'mikrotik_unmatching_secret') {
    ($obj->userMenuePermission('mikrotik_unmatching_secret')) ? include 'pages/mikrotik/unmatching_secret.php' : include $homepage;
}
elseif ($page == 'mikrotik_static_unmatching_secret') {
    ($obj->userMenuePermission('mikrotik_static_unmatching_secret')) ? include 'pages/mikrotik/mikrotik_static_unmatching_secret.php' : include $homepage;
}
elseif ($page == 'device_list') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/device_list.php' : include $homepage;
}
elseif ($page == 'interface_state') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/interface_state.php' : include $homepage;
}
elseif ($page == 'mactable') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/mactable.php' : include $homepage;
}
elseif ($page == 'onu_info') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/onu_info.php' : include $homepage;
}
elseif ($page == 'device_condition') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/device_condition.php' : include $homepage;
}
elseif ($page == 'olt_diagram') {
    ($obj->userMenuePermission('device_list')) ? include 'pages/olt/olt_diagram.php' : include $homepage;
}


elseif ($page == 'account_head_view') {
    ($obj->userMenuePermission('account_head_view')) ? include 'pages/expence/account_head_view.php' : include $homepage;
} elseif ($page == 'account_sub_head_view') {
    ($obj->userMenuePermission('account_sub_head_view')) ? include 'pages/expence/account_sub_head_view.php' : include $homepage;
} elseif ($page == 'view_expence') {
    ($obj->userMenuePermission('view_expence')) ? include 'pages/expence/view_expence.php' : include $homepage;
} elseif ($page == 'expence_report') {
    ($obj->userMenuePermission('expence_report')) ? include 'pages/expence/expence_report.php' : include $homepage;
} elseif ($page == 'employee_view') {
    ($obj->userMenuePermission('employee_view')) ? include 'pages/employee/employee_view.php' : include $homepage;
} elseif ($page == 'employee_create') {
    ($obj->userMenuePermission('employee_create')) ? include 'pages/employee/employee_create.php' : include $homepage;
}
elseif ($page == 'employee_ladger') {
    ($obj->userMenuePermission('employee_ladger')) ? include 'pages/employee/employee_ladger.php' : include $homepage;
}
elseif ($page == 'add_employee_salary') {
    ($obj->userMenuePermission('add_employee_salary')) ? include 'pages/employee/add_employee_salary.php' : include $homepage;
}
elseif ($page == 'pay_salary') {
    ($obj->userMenuePermission('pay_salary')) ? include 'pages/employee/pay_salary.php' : include $homepage;
}
elseif ($page == 'employee_edit') {
    ($obj->userMenuePermission('employee_edit')) ? include 'pages/employee/employee_edit.php' : include $homepage;
} elseif ($page == 'attedance') {
    ($obj->userMenuePermission('attedance')) ? include 'pages/employee/attedance.php' : include $homepage;
} elseif ($page == 'attendance_report') {
    ($obj->userMenuePermission('attendance_report')) ? include 'pages/employee/attendance_report.php' : include $homepage;
} elseif ($page == 'view_all_income') {
    ($obj->userMenuePermission('view_all_income')) ? include 'pages/income/view_all_income.php' : include $homepage;
} elseif ($page == 'connection_charge') {
    ($obj->userMenuePermission('connection_charge')) ? include 'pages/income/connection_charge.php' : include $homepage;
} elseif ($page == 'view_bonous') {
    ($obj->userMenuePermission('view_bonous')) ? include 'pages/bonus/view_bonous.php' : include $homepage;
} elseif ($page == 'same_bonus') {
    ($obj->userMenuePermission('same_bonus')) ? include 'pages/bonus/same_bonus.php' : include $homepage;
}elseif ($page == 'discount_statement') {
    ($obj->userMenuePermission('discount_statement')) ? include 'pages/bonus/discount_statement.php' : include $homepage;
} elseif ($page == 'view_diagram') {
    ($obj->userMenuePermission('view_diagram')) ? include 'pages/diagram/view_diagram.php' : include $homepage;
} elseif ($page == 'edit_complain') {
    ($obj->userMenuePermission('edit_complain')) ? include 'pages/complain/edit_complain.php' : include $homepage;
} elseif ($page == 'add_complain') {
    ($obj->userMenuePermission('add_complain')) ? include 'pages/complain/add_complain.php' : include $homepage;
} elseif ($page == 'view_complain') {
    ($obj->userMenuePermission('view_complain')) ? include 'pages/complain/view_complain.php' : include $homepage;
} elseif ($page == 'complain_template') {
    ($obj->userMenuePermission('complain_template')) ? include 'pages/complain/complain_template.php' : include $homepage;
} elseif ($page == 'edit_complain_template') {
    ($obj->userMenuePermission('edit_complain_template')) ? include 'pages/complain/edit_complain_template.php' : include $homepage;
} elseif ($page == 'individual_complain_details') {
    ($obj->userMenuePermission('individual_complain_details')) ? include 'pages/complain/individual_complain_details.php' : include $homepage;
} elseif ($page == 'monthly_new') {
    ($obj->userMenuePermission('monthly_new')) ? include 'pages/balance_sheet/monthly_balance_report.php' : include $homepage;
} elseif ($page == 'yearly') {
    ($obj->userMenuePermission('yearly')) ? include 'pages/balance_sheet/yearly_balance_report.php' : include $homepage;
} elseif ($page == 'customer_billing_history') {
    ($obj->userMenuePermission('customer_billing_history')) ? include 'pages/balance_sheet/customer_billing_history.php' : include $homepage;
} elseif ($page == 'add_customize_sms') {
    ($obj->userMenuePermission('add_customize_sms')) ? include 'pages/sms/add_customize_sms.php' : include $homepage;
} elseif ($page == 'activity_log') {
    include 'pages/activity_log/activity_log.php';
} elseif ($page == 'cron_mikrotik_activity') {
    include 'pages/activity_log/cron_job_mikrotik_activity_log.php';
} elseif ($page == 'cron_sms_activity') {
    include 'pages/activity_log/cron_job_sms_activity_log.php';
} elseif ($page == 'due_sms') {
    ($obj->userMenuePermission('due_sms')) ? include 'pages/sms/add_duesms.php' : include $homepage;
} elseif ($page == 'send_due_sms') {
    ($obj->userMenuePermission('send_due_sms')) ? include 'pages/sms/send_due_sms.php' : include $homepage;
} elseif ($page == 'sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/sms_custom.php' : include $homepage;
} elseif ($page == 'customize_single_due_sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/customize_single_due_sms.php' : include $homepage;
} elseif ($page == 'customize_paid_sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/customize_paid_sms.php' : include $homepage;
} elseif ($page == 'customize_advance_paid_sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/customize_advance_paid_sms.php' : include $homepage;
} elseif ($page == 'customize_new_customer_sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/customize_new_customer_sms.php' : include $homepage;
} elseif ($page == 'customize_complain_sms') {
    ($obj->userMenuePermission('sms')) ? include 'pages/sms/customize_complain_sms.php' : include $homepage;
} elseif ($page == 'product_category') {
    ($obj->userMenuePermission('product_category')) ? include 'pages/inventory/product/product_category.php' : include $homepage;
} elseif ($page == 'product') {
    ($obj->userMenuePermission('product')) ? include 'pages/inventory/product/product.php' : include $homepage;
} elseif ($page == 'supplier') {
    ($obj->userMenuePermission('supplier')) ? include 'pages/inventory/supplier/supplier.php' : include $homepage;
} elseif ($page == 'purchase') {
    ($obj->userMenuePermission('purchase')) ? include 'pages/inventory/purchase/purchase.php' : include $homepage;
} elseif ($page == 'stock') {
    ($obj->userMenuePermission('stock')) ? include 'pages/inventory/stock.php' : include $homepage;
} elseif ($page == 'sales') {
    ($obj->userMenuePermission('sales')) ? include 'pages/inventory/sales/sales.php' : include $homepage;
} elseif ($page == 'customer_return') {
    ($obj->userMenuePermission('customer_return')) ? include 'pages/inventory/return/customer_return.php' : include $homepage;
} elseif ($page == 'supplier_return') {
    ($obj->userMenuePermission('supplier_return')) ? include 'pages/inventory/return/supplier_return.php' : include $homepage;
} elseif ($page == 'business_target') {
    ($obj->userMenuePermission('business_target')) ? include 'pages/target/business_target.php' : include $homepage;


    //=====================================================================================================================================================================
    // ============================================================Reseller Admin panel===========================================================================================================
    //=====================================================================================================================================================================
}elseif ($page == 'reseller_create') {
    ($obj->userMenuePermission('reseller_create')) ? include 'pages/admin_reseller/reseller_create.php' : include $homepage;
}elseif ($page == 'reseller_view') {
    ($obj->userMenuePermission('reseller_view')) ? include 'pages/admin_reseller/reseller_view.php' : include $homepage;
}elseif ($page == 'admin-reseller-software-secretlist') {
    ($obj->userMenuePermission('reseller_view')) ? include 'pages/admin_reseller/admin_reseller_software_secretlist.php' : include $homepage;
}elseif ($page == 'reseller-ledger') {
    ($obj->userMenuePermission('reseller_ledger')) ? include 'pages/admin_reseller/ladger_on_reseller.php' : include $homepage;
}elseif ($page == 'reseller-customer-bill-collection') {
    ($obj->userMenuePermission('reseller_customer_bill_collection')) ? include 'pages/admin_reseller/reseller_customer_bill_collection.php' : include $homepage;
}elseif ($page == 'reseller-mikrotik') {
    ($obj->userMenuePermission('reseller_mikrotik')) ? include 'pages/admin_reseller/reseller_mikrotik.php' : include $homepage;
}elseif ($page == 'reseller-mikrotik') {
    ($obj->userMenuePermission('reseller_mikrotik')) ? include 'pages/admin_reseller/reseller_mikrotik.php' : include $homepage;
} elseif ($page == 'reseller-package-list') {
    ($obj->userMenuePermission('reseller_package')) ? include 'pages/admin_reseller/reseller_package.php' : include $homepage;
} elseif ($page == 'reseller-customer-list') {
    ($obj->userMenuePermission('reseller_customer')) ? include 'pages/admin_reseller/reseller_customer.php' : include $homepage;
}elseif ($page == 'admin-reseller-balance-sheet') {
    ($obj->userMenuePermission('admin_reseller_balance_sheet')) ? include 'pages/admin_reseller/statement/admin_reseller_balance_sheet.php' : include $homepage;
}elseif ($page == 'admin-reseller-history') {
    ($obj->userMenuePermission('admin_reseller_history')) ? include 'pages/admin_reseller/admin_reseller_history.php' : include $homepage;
}elseif($page == 'admin-reseller-customer-unmatching'){
    include 'pages/admin_reseller/reseller_mikrotik_unmatching.php';
}elseif($page == 'admin-reseller-sms-settings'){
    include 'pages/admin_reseller/reseller_sms_settings.php';
}elseif($page == 'admin_reseller_cron_job_settings'){
    include 'pages/admin_reseller/reseller_cron_job_settings.php';
}elseif($page == 'reseller-login'){
    include 'pages/admin_reseller/reseller_login.php';
}elseif($page == 'admin-reseller-software-unmatching'){
    include 'pages/admin_reseller/reseller_software_unmatching.php';
}elseif ($page == 'admin-reseller-customer-edit') {
    ($obj->userMenuePermission('reseller_admin_customer_edit')) ? include 'pages/admin_reseller/customer_edit.php' : include $homepage;

    // ===============================================================================================================================================================
    // ============================================================Reseller Personal Dashboard===========================================================================================================
    //=====================================================================================================================================================================
}elseif ($page == 'reseller-dashboard') {
     include 'pages/resellers/dashboard/home.php' ;
}elseif($page == 'reseller-all-customer-list'){
    include 'pages/resellers/customer/customer_list.php';
}elseif($page == 'reseller-new-customer-add'){
    include 'pages/resellers/customer/reseller_new_customer_add.php';
}elseif($page == 'reseller-customer-ledger'){
    include 'pages/resellers/customer/reseller_customer_ledger.php';
}
elseif($page == 'reseller-customer-edit'){
    include 'pages/resellers/customer/customer_edit.php';
}

//olt 

elseif ($page == 're_device_list') {
    include 'pages/resellers/olt/device_list.php';
}
elseif ($page == 're_interface_state') {
 include 'pages/resellers/olt/interface_state.php' ;
}
elseif ($page == 're_mactable') {
 include 'pages/resellers/olt/mactable.php' ;
}
elseif ($page == 're_onu_info') {
 include 'pages/resellers/olt/onu_info.php' ;
}
elseif ($page == 're_device_condition') {
 include 'pages/resellers/olt/device_condition.php' ;
}
elseif ($page == 're_olt_diagram') {
 include 'pages/resellers/olt/olt_diagram.php';
}




elseif($page == 'reseller-list-package'){
    include 'pages/resellers/package/reseller_list_package.php';
}elseif($page == 'reseller-edit-package'){
    include 'pages/resellers/package/reseller_edit_package.php';
}elseif($page == 'reseller-bill-collection'){
    include 'pages/resellers/billcollection/reseller_bill_collection.php';
}elseif($page == 'reseller-customer-bulk-recharge'){
    include 'pages/resellers/billcollection/reseller_customer_bulk_recharge.php';
}elseif($page == 'reseller-customer-bulk-partial-recharge'){
    include 'pages/resellers/billcollection/reseller_customer_bulk_partial_recharge.php';
}elseif($page == 'reseller-previouse-customer-due'){
    include 'pages/resellers/customer/customer_previouse_deu.php';
}elseif($page == 'reseller-customer-paid-this-month'){
    include 'pages/resellers/billcollection/reseller_customer_paid_this_month.php';
}elseif($page == 'reseller-customer-online-status'){
    include 'pages/resellers/customer/reseller_customer_online_status.php';
}elseif($page == 'reseller-customer-ofline-status'){
    include 'pages/resellers/customer/reseller_customer_ofline_status.php';
}elseif($page == 'reseller-customer-unmatching'){
    include 'pages/resellers/customer/reseller_unmatching_customer.php';
}elseif($page == 'reseller-customer-matching'){
    include 'pages/resellers/customer/reseller_secret_customer.php';
}
elseif($page == 'reseller-all-customer-zone'){
    include 'pages/resellers/customer/customer_zone.php';
}
elseif($page == 'reseller-admin-login'){
    include 'pages/resellers/admin_login.php';
}
elseif ($page == 'access-denied'){
    include '404.php';
} elseif ($page == 're_due_sms') {
     include 'pages/resellers/sms/add_duesms.php';
} elseif ($page == 're_send_due_sms') {
     include 'pages/resellers/sms/send_due_sms.php';
} elseif ($page == 're_sms') {
    include 'pages/resellers/sms/sms_custom.php';
} elseif ($page == 're_customize_single_due_sms') {
    include 'pages/resellers/sms/customize_single_due_sms.php';
} elseif ($page == 're_customize_paid_sms') {
    include 'pages/resellers/sms/customize_paid_sms.php';
} elseif ($page == 're_customize_advance_paid_sms') {
     include 'pages/resellers/sms/customize_advance_paid_sms.php' ;
} elseif ($page == 're_customize_new_customer_sms') {
    include 'pages/resellers/sms/customize_new_customer_sms.php';
} elseif ($page == 're_customize_complain_sms') {
     include 'pages/resellers/sms/customize_complain_sms.php';
}elseif ($page == 're_my_settings') {
     include 'pages/resellers/settings/settings.php';
}elseif ($page == 'reseller-activity-history') {
     include 'pages/resellers/admin_reseller_history.php';
}elseif ($page == 'reseller-mikrotik-activity') {
     include 'pages/resellers/cron_job_mikrotik_activity_log.php';
}elseif ($page == 'reseller-recharge') {
     include 'pages/resellers/admin_reseller_recharge.php';
}elseif ($page == 'reseller-statement') {
     include 'pages/resellers/statement/admin_reseller_statement.php';
}elseif($page == 'reseller-delete-customer'){
    include 'pages/resellers/customer/delete_log.php';
}
elseif($page == 'reseller-partial-customer'){
    include 'pages/resellers/billcollection/reseller_customer_bulk_partial_recharge.php';
}
else {
    if($_SESSION['usertype'] == 'RE'){
        include $reHomepage;
    }else{
        include $homepage;
    }
}