/**
 *
 */
angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRouterProvider, $locationProvider) {

    $locationProvider.hashPrefix('');
    //trở về trang mặc định
    $urlRouterProvider.otherwise("/admin");

    $stateProvider
        .state("layout3", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout3.html"
                }
            }
        })
        .state("layout4", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout4.html"
                }
            }
        })
        .state("admin", {
            parent: 'layout3',
            url: "/admin",
            views: {
                "content": {
                    templateUrl: "pages/adminhome/admin-home.html",
                    controller:"adminController"
                }
            }
        })
        .state("login", {
            parent: 'layout4',
            url: "/login",
            views: {
                "content": {
                    templateUrl: "pages/login/login.html",
                    controller: "loginController"
                }
            }
        })
        .state("register", {
            parent: 'layout4',
            url: "/register",
            views: {
                "content": {
                    templateUrl: "pages/login/register.html",
                    controller: "loginController"
                }
            }
        })
        .state("forgot-password", {
            parent: 'layout4',
            url: "/forgot-password",
            views: {
                "content": {
                    templateUrl: "pages/login/forgot-password.html",
                    controller: "loginController"
                }
            }
        })
        .state("employees", {
            parent: 'layout3',
            url: "/employees",
            views: {
                "content": {
                    templateUrl: "pages/employee/employee.html",
                    controller: "employeeController"
                }
            }
        })
        .state("project", {
            parent: 'layout3',
            url: "/project",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectListViews.html",
                    controller: "showProject"
                }
            }
        })

        .state("addproject", {
            parent: 'layout3',
            url: "/addproject",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectAddViews.html",
                    controller: "insertProject"
                }
            }
        })

//======================================================================================================================
//Hieunv
        .state("reportProject", {
            parent: 'layout3',
            url: "/report/project",
            views: {
                "content": {
                    templateUrl: "pages/report/timeSheetReport.html",
                    controller: "reportController"
                }
            }
        })

        .state("reportTimeSheet", {
            parent: 'layout3',
            url: "/report/project/:ID/timeSheet",
            views: {
                "content": {
                    templateUrl: "pages/report/timeSheetListViews.html",
                    controller: "timeSheetListController"
                }
            }
        })

        .state("reportEmployee", {
            parent: 'layout3',
            url: "/report/project/:ID/employee",
            views: {
                "content": {
                    templateUrl: "pages/report/employeeListViews.html",
                    controller: "listLackOfReportController"
                }
            }
        })

        .state("report2", {
            parent: 'layout3',
            url: "/report/project2",
            views: {
                "content": {
                    templateUrl: "pages/report/reportPage.html",
                    controller: "reportController"
                }
            }
        })

        .state("allReport", {
            parent: 'layout3',
            url: "/report/project/:ID/allReport",
            views: {
                "content": {
                    templateUrl: "pages/report/reportListPage.html",
                    controller: "allProjectReportController"
                }
            }
        })

        .state("reportDetail", {
            parent: 'layout3',
            url: "/report/reportDetail/:ID",
            views: {
                "content": {
                    templateUrl: "pages/report/reportDetailPage.html",
                    controller: "projectReportDetailController"
                }
            }
        })

        .state("reportEmployeeLack", {
            parent: 'layout3',
            url: "/report/project/:ID/employeeReport",
            views: {
                "content": {
                    templateUrl: "pages/report/employeeListViews1.html",
                    controller: "listEmployeeLackController"
                }
            }
        })


//Hieunv
//======================================================================================================================
        .state("editproject", {
            parent: 'layout3',
            url: "/editproject/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectEditViews.html",
                    controller: "loadProjectDetail"
                }
            }
        })
        .state("groupProjectByProjectId", {
            parent: 'layout3',
            url: "/groupProjectByProjectId/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectView.html",
                    controller: "loadGroupProjectByProjectId"
                }
            }
        })
        .state("addEmployeeProject", {
            parent: 'layout3',
            url: "/addEmployeeProject",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectAddView.html",
                    controller: "insertEmployeeProject"
                }
            }
        })
});
