-
Notifications
You must be signed in to change notification settings - Fork 0
/
render.go
48 lines (37 loc) · 1.16 KB
/
render.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"html/template"
"net/http"
)
var temp *template.Template
var temp1 *template.Template
var temp2 *template.Template
func init() {
temp = template.Must(template.ParseGlob("templete/homepage/*.html"))
temp1 = template.Must(template.ParseGlob("templete/custmer/*.html"))
temp2 = template.Must(template.ParseGlob("templete/admin/*.html"))
}
func homepage(w http.ResponseWriter, r *http.Request) {
temp.ExecuteTemplate(w, "index.html", nil)
}
func login(w http.ResponseWriter, r *http.Request) {
temp.ExecuteTemplate(w, "login.html", nil)
}
func signup(w http.ResponseWriter, r *http.Request) {
temp.ExecuteTemplate(w, "signup.html", nil)
}
func contactus(w http.ResponseWriter, r *http.Request) {
temp.ExecuteTemplate(w, "Contactus.html", nil)
}
func weed(w http.ResponseWriter, r *http.Request) {
temp2.ExecuteTemplate(w, "upload.html", nil)
}
func custmer(w http.ResponseWriter, r *http.Request) {
temp1.ExecuteTemplate(w, "cusdash.html", nil)
}
func admin(w http.ResponseWriter, r *http.Request) {
temp2.ExecuteTemplate(w, "admin.html", nil)
}
func deteil(w http.ResponseWriter, r *http.Request) {
temp2.ExecuteTemplate(w, "deteil.html", nil)
}