<?php
session_start();
include "root.class.php";
new root_styles();
$roots = new root();
$roots->OnPageScripts();
new login_system();
new online_check();

$navbar = new navbar();

$navbar->add_logo();

if (@$_SESSION['user_type'] == "ADMIN") {

    // $navbar->open_group("add");
    // $navbar->add_button("variety", "add/variety_home.php", "variety", "variety");
    // $navbar->add_button("clients", "add/client_home.php", "client", "client");
    // $navbar->add_button("drying bins", "add/drying_bin_home.php", "drying bins", "drying bins");
    // $navbar->add_button("silo", "add/silo_home.php", "silo", "silo");
    // $navbar->add_button("user", "add/user_home.php", "user", "user");
    // $navbar->end_group();

    // $navbar->open_group("processing");
    // $navbar->add_heading("RECEIVE");
    // $navbar->add_button("receive nuts", "receive/pre_check.php", "receive nuts", "receive nuts");
    // $navbar->add_heading("DEHUSKING");
    // $navbar->add_button("home", "receive/home.php", "home", "home");
    // $navbar->add_button("dehusking", "dehusk/home.php", "dehusk", "dehusk");
    // $navbar->add_button("move to drying bin", "bins/check_bins.php", "move to drying bin", "move to drying bin");

    // $navbar->add_heading("DRYING BINS");
    // $navbar->add_button("drying bins", "bins/home.php", "drying bins", "drying bins");

    // $navbar->add_heading("SILO");
    // $navbar->add_button("silo", "silo/silo.php", "silo", "silo");

    // $navbar->add_heading("CRACKING");
    // $navbar->add_button("cracking", "cracking/cracking.php", "cracking", "cracking");

    // $navbar->add_heading("SORTING");
    // $navbar->add_button("sorting", "sorting/sorting.php", "sorting", "sorting");
    // $navbar->end_group();

    // $navbar->open_group("pre-crack inspection");
    // // $navbar->add_heading("RESOURCES");
    // // $navbar->add_button("pre-crack analysis", "receive/pre_crack_analysis.php", "pre-crack analysis", "pre-crack analysis");
    // $navbar->add_button("nut analysis form", "pre-crack/nut_analysis_form.php", "nut analysis form", "nut analysis form");
    // // $navbar->add_button("nut analysis", "pre-crack/nut_analysis.php", "nut analysis status", "nut analysis status");
    // $navbar->add_button("dnis inspection", "pre-crack/dnis_inspection.php", "dnis inspection", "dnis inspection");
    // $navbar->add_button("kernal inspection", "pre-crack/kernal_analysis.php", "kernal inspection", "kernal inspection");
    // $navbar->add_button("style breakdown", "pre-crack/style_breakdown.php", "style breakdown", "style breakdown");
    // // $navbar->add_button("pre-crack analysis", "receive/pre_crack_analysis.php", "pre-crack analysis", "pre-crack analysis");
    // // $navbar->add_button("pre-crack analysis", "receive/pre_crack_analysis.php", "pre-crack analysis", "pre-crack analysis");
    // // $navbar->add_button("pre-crack analysis", "receive/pre_crack_analysis.php", "pre-crack analysis", "pre-crack analysis");
    // $navbar->end_group();

    // $navbar->open_group("documents");
    // $navbar->add_button("visitor hygiene policy", "policy/visitor_hygiene_policy.php", "visitor hygiene policy", "visitor hygiene policy");
    // $navbar->add_button("allergen management", "policy/allergen_management.php", "allergen management", "allergen management");
    // $navbar->add_button("employee allergen management", "policy/employee_allergen_management.php", "employee allergen management", "employee allergen management");
    // $navbar->end_group();

    $navbar->open_group("training and evaluation");
    $navbar->add_button("tests", "training/tests.php", "tests", "tests");
    $navbar->add_button("attempt test", "training/bookings.php", "attempt test", "attempt test ");
    $navbar->add_button("bookings", "training/book_test.php", "bookings", "bookings");
    // $navbar->add_button("hygiene training", "training/hygiene_training.php", "hygiene training", "hygiene training");
    // $navbar->add_button("pest control training", "training/pest_control.php", "pest control training", "pest control training");
    // $navbar->add_button("supplier evaluation", "training/supplier_evaluation.php", "supplier evaluation", "supplier evaluation");
    $navbar->add_button("internal training register", "capture/internal_training_register.php", "internal training-register", "internal training register");
    // $navbar->add_button("training", "training/training.php", "training", "training");
    $navbar->end_group();

    $navbar->open_group("maintenance");
    $navbar->add_button("request maintenance", "maintenance/request_maintenance.php", "request maintenance", "request maintenance");
    $navbar->add_button("maintenance allocation", "maintenance/maintenance_allocation.php", "maintenance allocation", "maintenance allocation");
    $navbar->add_button("maintenance jobcard", "maintenance/jobcards.php", "maintenance jobcard", "maintenance jobcard");
    $navbar->add_button("maintenance sign off", "maintenance/maintenance_sign_off.php", "maintenance sign off", "maintenance sign off");
    $navbar->add_button("post maintenance", "maintenance/post_maintenance.php", "post maintenance", "post maintenance");
    $navbar->end_group();

} else if ($_SESSION['user_type'] == "DEV") {

    $navbar->open_group("add");
    $navbar->add_button("variety", "add/variety_home.php", "variety", "variety");
    $navbar->add_button("equipment", "equipment/equipment_home.php", "equipment", "equipment");
    $navbar->add_button("product sample point", "add/sample_point_home.php", "product sample point", "product sample point");
 
    $navbar->add_button("user", "add/user_home.php", "user", "user");
    $navbar->end_group();

    // $navbar->open_group("management");
    // // $navbar->add_heading("CAPTURE");
    // $navbar->add_button("analysis-result", "capture/analysis_result.php", "analysis-result", "analysis-result");
    // $navbar->add_button("change management", "capture/change_management.php", "change management", "change management");
    // $navbar->add_button("internal training register", "capture/internal_training_register.php", "internal training-register", "internal training register");

    // $navbar->end_group();

    $navbar->open_group("processing");
    // $navbar->add_heading("RECEIVE");
    // $navbar->add_button("receive nuts", "receive/pre_check.php", "receive nuts", "receive nuts");
    // $navbar->add_heading("DEHUSKING");
    // $navbar->add_button("home", "receive/home.php", "home", "home");
    // $navbar->add_button("dehusking", "dehusk/home.php", "dehusk", "dehusk");
    // $navbar->add_button("move to drying bin", "bins/check_bins.php", "move to drying bin", "move to drying bin");

    // $navbar->add_heading("DRYING BINS");
    // $navbar->add_button("drying bins", "bins/home.php", "drying bins", "drying bins");

    // $navbar->add_heading("SILO");
    // $navbar->add_button("silo", "silo/silo.php", "silo", "silo");

    // $navbar->add_heading("CRACKING");
    $navbar->add_button("cracking", "cracking/home.php", "cracking", "cracking");

    // $navbar->add_heading("SORTING");
    $navbar->add_button("sorting", "sorting/sorting_home.php", "sorting", "sorting");
    $navbar->add_button("lop rooms", "lop/lop_home.php", "lop rooms", "lop rooms");
    $navbar->add_button("final sorting", "sorting/final_sorting_home.php", "final sorting", "final sorting");

    $navbar->end_group();

    // $navbar->open_group("supplier");
    // $navbar->add_button("delivery request", "supplier/delivery_request.php", "delivery request", "delivery request");
    // $navbar->add_button("request status", "supplier/request_status.php", "request status", "request status");
    // $navbar->add_button("supplier profile", "supplier/supplier_profile.php", "supplier profile", "supplier profile");
    // $navbar->add_button("qa sample managment", "supplier/qa_sample_managment.php", "qa sample managment", "qa sample managment");
    // $navbar->add_button("raw material coa delivery request", "supplier/coa_delivery_request.php", "coa delivery request", "coa delivery request");
    // $navbar->add_button("delivery shedule request", "supplier/delivery_shedule_request.php", "delivery shedule request", "delivery shedule request");
    // $navbar->end_group();

    // $navbar->open_group("reports");
    // $navbar->add_heading("REPORTS");
    // $navbar->add_button("nuts received", "reports/nuts_received.php", "nuts received", "nuts received");
    // $navbar->add_button("dehusk", "reports/dehusk.php", "dehusk", "dehusk");
    // $navbar->add_button("drying bins", "reports/drying_bins.php", "drying bins", "drying bins");
    // $navbar->add_button("clients", "reports/clients.php", "clients", "clients");
    // $navbar->add_button("batches", "reports/batches.php", "batches", "batches");
    // $navbar->add_button("cracking", "cracking/report_home.php", "cracking", "cracking");
    // $navbar->add_button("sorting", "sorting/report_home.php", "sorting", "sorting");
    // $navbar->add_button("lop rooms", "lop/report_home.php", "lop rooms", "lop rooms");
    // $navbar->add_button("final sorting", "sorting/final_report_home.php", "cracking", "final sorting");
    // $navbar->end_group();


    // $navbar->add_heading("DASHBOARDS");
    // $navbar->add_button("dashboard", "dashboard/home.php", "dashboard", "Home");

    // $navbar->add_heading("SILO");
    // $navbar->add_button("silo", "silo/home.php", "silo", "silo");

    // $navbar->add_heading("CAPTURE");
    // $navbar->add_button("analysis-result", "capture/analysis_result.pdf.php", "analysis-result", "analysis-result");
    // $navbar->add_button("change-management", "capture/change_management.pdf.php", "change-management", "change-management");
    // $navbar->end_group();

    // $navbar->open_group("manuals");
    // $navbar->add_heading("RESOURCES");
    // $navbar->add_button("navbar", "manual/navbar.php", "navbar", "navbar");
    // $navbar->add_button("add", "manual/add.php", "add", "add");

    // $navbar->add_heading("SYSTEM");
    // $navbar->add_button("receive", "manual/receive.php", "receive", "receive");
    // $navbar->add_button("dehusking", "manual/dehusking.php", "dehusking", "dehusking");
    // $navbar->add_button("drying bins", "manual/drying_bins.php", "drying bins", "drying bins");
    // $navbar->add_button("cracking", "manual/cracking.php", "cracking", "cracking");

    // $navbar->add_heading("REPORTS");
    // $navbar->add_button("silo", "manual/silo.php", "silo", "silo");
    // $navbar->end_group();

    // $navbar->open_group("pre-take inspection");
    // // $navbar->add_heading("RESOURCES");
    // $navbar->add_button("pre-intake inspection", "receive/pre_intake_inspection.php", "pre-intake inspection", "pre-intake inspection");
    // // $navbar->add_button("pre-inspection", "receive/pre_inspection.php", "pre-inspection", "pre-inspection");
    // $navbar->add_button("order details", "receive/order_details.php", "order details", "order details");
    // $navbar->add_button("vehicle checks", "receive/vehicle_checks.php", "vehicle checks", "vehicle checks");
    // $navbar->add_button("initial quality inspection", "receive/quality_inspection.php", "initial quality inspection", "initial quality inspection");
    // $navbar->add_button("intake analysis evaluation", "receive/intake_analysis.php", "intake analysis evaluation", "intake analysis evaluation");
    // $navbar->add_button("pre-crack analysis", "receive/pre_crack_analysis.php", "pre-crack analysis", "pre-crack analysis");
    // $navbar->end_group();

    // $navbar->open_group("documents");
    // $navbar->add_button("visitor hygiene policy", "policy/visitor_hygiene_policy.php", "visitor hygiene policy", "visitor hygiene policy");
    // $navbar->add_button("allergen management", "policy/allergen_management.php", "allergen management", "allergen management");
    // $navbar->add_button("employee allergen management", "policy/employee_allergen_management.php", "employee allergen management", "employee allergen management");
    // $navbar->end_group();

    // $navbar->open_group("training and evaluation");
    // $navbar->add_button("allergen training", "training/allergen_training.php", "allergen training", "allergen training");
    // $navbar->add_button("hygiene training", "training/hygiene_training.php", "hygiene training", "hygiene training");
    // $navbar->add_button("pest control training", "training/pest_control.php", "pest control training", "pest control training");
    // $navbar->add_button("supplier evaluation", "training/supplier_evaluation.php", "supplier evaluation", "supplier evaluation");
    // $navbar->end_group();

} else if ($_SESSION['user_type'] == "SUPPLIER") {
    $navbar->open_group("supplier");
    $navbar->add_button("delivery request", "supplier/delivery_request.php", "delivery request", "delivery request");
    // $navbar->add_button("request status", "supplier/request_status.php", "request status", "request status");
    // $navbar->add_button("supplier profile", "supplier/supplier_profile.php", "supplier profile", "supplier profile");
    // $navbar->add_button("qa sample managment", "supplier/qa_sample_managment.php", "qa sample managment", "qa sample managment");
    // $navbar->add_button("raw material coa delivery request", "supplier/coa_delivery_request.php", "coa delivery request", "coa delivery request");
    // $navbar->add_button("delivery shedule request", "supplier/delivery_shedule_request.php", "delivery shedule request", "delivery shedule request");
    $navbar->end_group();
} else if ($_SESSION['user_type'] == "EMPLOYEE") {
    $navbar->open_group("receive");
    $navbar->add_heading("RECEIVE");
    $navbar->add_button("pre-check", "receive/pre_check.php", "pre-check", "pre-check");
    $navbar->add_button("check", "receive/check.php", "check", "check");
    $navbar->end_group();

    $navbar->open_group("dehusk");
    $navbar->add_button("dehusking", "dehusk/home.php", "dehusk", "dehusk");
    $navbar->end_group();

    $navbar->open_group("drying bins");
    $navbar->add_button("bins", "bins/home.php", "bins", "bins");
    $navbar->end_group();

    $navbar->open_group("manuals");
    $navbar->add_heading("SYSTEM");
    $navbar->add_button("navbar", "manual/navbar.php", "navbar", "navbar");
    $navbar->add_button("add", "manual/add.php", "add", "add");
    $navbar->add_button("receive", "manual/receive.php", "receive", "receive");
    $navbar->add_button("dehusking", "manual/dehusking.php", "dehusking", "dehusking");
    $navbar->add_button("drying bins", "manual/drying_bins.php", "drying bins", "drying bins");
    $navbar->add_button("silo", "manual/silo.php", "silo", "silo");
    $navbar->end_group();
} else if ($_SESSION['user_type'] == "QA") {
    $navbar->open_group("supplier");
    $navbar->add_button("qa sample managment", "supplier/qa_sample_managment.php", "qa sample managment", "qa sample managment");
    $navbar->add_button("request status", "supplier/request_status.php", "request status", "request status");
    $navbar->add_button("delivery shedule request", "supplier/delivery_shedule_request.php", "delivery shedule request", "delivery shedule request");
    $navbar->end_group();
} else if ($_SESSION['user_type'] == "SECURITY") {
    $navbar->open_group("policy");
    $navbar->add_button("visitor hygiene policy", "policy/visitor_hygiene_policy.php", "visitor hygiene policy", "visitor hygiene policy");
    $navbar->end_group();
}

$navbar->add_logout_button();
$navbar->navbar_end();
$roots->Main_iframe();
?>