% if !_site.has_rank?("admin") _hb.alert(_("You are not an administrator and cannot view this page.")).back end if _get["choice"] == "dosave" save_hash = { :name => _post["texname"] } end if _get["customer_id"].to_i > 0 customer = _ob.get(:Customer, _get["customer_id"]) title = sprintf(_("Edit customer: %s"), customer.name.html) if _get["choice"] == "dosave" customer.update(save_hash) _hb.redirect("?show=customer_edit&customer_id#{customer.id}") end if _get["choice"] == "dodelete" _hb.on_error_go_back do _ob.delete(customer) _hb.redirect("?show=customer_search") end end else title = _("Add new customer") if _get["choice"] == "dosave" _hb.on_error_go_back do customer = _ob.add(:Customer, save_hash) _hb.redirect("?show=customer_edit&customer_id=#{customer.id}") end end end print _site.header(title) %>