Ejemplo n.º 1
0
func (c Application) GroupCurrent(groupName string) revel.Result {
	group := models.Groups{}
	err := c.DB.Where("name = ?", groupName).First(&group).Error

	if err != nil {
		return c.Redirect(Application.Group)
	} else {
		faculties, groups, years := database.GroupsData(c.DB)
		days, pairs := database.DaysPairsData(c.DB)
		days_out := database.GroupSchedule(c.DB, group.Id, days, pairs)

		return c.Render(faculties, groups, years, days, pairs, group, days_out)
	}
}
Ejemplo n.º 2
0
func (c Application) Group() revel.Result {
	faculties, groups, years := database.GroupsData(c.DB)
	days, pairs := database.DaysPairsData(c.DB)
	return c.Render(faculties, groups, years, days, pairs)
}