Exemplo n.º 1
0
func (this *EventController) Update() {
	password := this.GetString("password")
	if password != "ronak123" {
		this.Data["json"] = failjson
		this.ServeJson()
		return
	}
	title := this.GetString("title")
	description := this.GetString("description")
	t := this.GetString("time")
	club := this.GetString("club")
	location := this.GetString("location")
	lastmod := int(time.Now().Unix())
	event := models.Event{}
	event.Title = title
	event.Description = description
	event.Club = club
	event.Location = location
	tim, _ := strconv.Atoi(t)
	event.Time = tim
	event.Lastmod = lastmod
	_, status := event.UpdateByTitle()
	if status != true {
		this.Data["json"] = failjson
		this.ServeJson()
		return
	} else {
		this.Data["json"] = passjson
		this.ServeJson()
		return
	}
}