-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenhtml_a1d3_wyk.awk
More file actions
66 lines (66 loc) · 2.18 KB
/
Copy pathgenhtml_a1d3_wyk.awk
File metadata and controls
66 lines (66 loc) · 2.18 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
BEGIN {
FS=",";
printf("<!DOCTYPE html> \n");
printf("<html>\n");
printf("<head>\n");
printf("<meta charset=\"utf-8\">\n");
printf("<title>WYK Administration Web App</title>\n");
printf("<link href=\"http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css\" rel=\"stylesheet\" type=\"text/css\"/>\n");
printf("<script src=\"http://code.jquery.com/jquery-1.5.min.js\" type=\"text/javascript\"></script>\n");
printf("<script src=\"http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js\" type=\"text/javascript\"></script>\n");
printf("</head> \n");
printf("<body> \n");
printf("<div data-role=\"page\" id=\"page_S1D1\">\n");
printf(" <div data-role=\"header\" data-position=\"fixed\">\n");
printf(" <h1>學界田徑決賽日</h1>\n");
printf("<a href=\"/index.html\" data-role=\"button\" data-icon=\"home\" class=\"ui-btn-right\" ></a>\n");
printf(" </div>\n");
printf("<div data-role=\"content\">\n");
printf("<ul data-role=\"listview\" data-filter=\"true\" data-divider-theme=\"b\">\n");
}
$1 ~ /^Event/ {
printf("<li data-role=\"list-divider\">%s</li>\n",$1);
printf(" <li>%s</li>\n",$2);
printf(" <li>%s</li>\n",$3);
}
$1 ~ /^Final/ {
printf(" <li>%s</li>\n",$1);
}
$1 ~ /^[0-9]/ {
if ($2 != "Group") {
command="awk -v StudentName=\"" $2 "\" -f get_class_no_chinese.awk sport_utf8.csv";
# print command;
system(command);
getline class_chinese < "ChineseName";
close("ChineseName");
getline class_no < "ClassNo";
close("ClassNo");
getline student_class < "StudentClass";
close("StudentClass");
getline student_number < "StudentNumber";
close("StudentNumber");
printf(" <li><a href=\"/public/school/student/class/%s/%s_e.html\">\n",student_class,student_number);
printf(" <img src=\"/local/student/photo/k%s.jpg\" />\n",class_no);
printf(" <h1>%s Lane %s</h1>\n",class_chinese,$1);
printf(" <p>%s</p>\n",$2);
printf(" </a></li>\n");
}
else {
printf(" <li>\n");
printf(" <h1>G R O U P Lane %s</h1>\n",$1);
printf(" </li>\n");
}
}
END {
# if (StartOfHeat == 1) {
# printf(" </Heat>\n");
# }
# if (StartOfEvent == 1) {
# printf(" </Event>\n");
# }
# printf("</Events>\n");
printf("</ul>\n");
printf("</div>\n");
printf("</div>\n");
printf("</body></html>\n");
}