-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.html
137 lines (95 loc) · 3.89 KB
/
forms.html
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>DSL Engineering</title>
<link rel="stylesheet" href="css/jquery.mobile-1.4.3.min.css">
<link rel="stylesheet" href="css/styles.css" />
<script src="jquery-1.10.2.min.js"></script>
<script src="jquery.mobile-1.4.3.min.js"></script>
<script src="main.js"></script>
</head>
<body>
<div id="formPage" data-role="page" data-theme="a">
<div data-role="header" data-position="fixed" data-theme="a">
<div data-role="controlgroup" data-type="horizontal" class="ui-btn-left">
<a href="#mypanel" data-role="button" data-icon="bars" data-iconpos="notext" style="height:35px;width:35px">Menu</a>
</div>
<img src="images/logo_sm.png" style="float:right" />
<h6 style="font-size:24px;color#06234B">Forms</h6>
</div>
<div data-role="content" >
<div class="title">Select a form for:</div>
<div class="title" id="companyName"></div>
<ul id="formList" data-role="listview" data-filter="true" data-inset="true" data-theme="a">
<li><a href="formcompanyaudit.html">Engineer Report</a></li>
<li><a href="form_personnel.html" data-ajax="false">List of Personnel</a></li>
</ul>
<div style="height:20px"></div>
<div class="title">Submitted forms:</div>
<ul id="historyList" data-role="listview" data-filter="false" data-inset="true" data-theme="a"></ul>
<div id="message"></div>
<div id="err" style="display:none"></div>
</div>
<div data-role="footer" data-position="fixed" >
<div data-role="navbar">
<ul>
<li><a id="btnPrev" href="company.html" data-icon="back">Back to Companies</a></li>
</ul>
</div>
</div>
<div data-role="panel" data-position="left" data-position-fixed="false" data-display="reveal" id="mypanel" data-theme="a">
<p style="text-align:center"><img src="images/logo.png" width="70%" /></p>
<div style="height:20px"></div>
<ul data-role="listview" data-filter="false" data-theme="a" data-inset="false">
<li><a href="company.html" data-rel="close" class="ui-btn ui-shadow ui-btn-a ui-icon-home ui-btn-icon-right" data-ajax="false">Companies</a></li>
<li><a href="settings.html" data-rel="close" class="ui-btn ui-shadow ui-btn-a ui-icon-gear ui-btn-icon-right" data-ajax="false">Settings</a></li>
</ul>
</div><!-- /panel -->
<script>
$(document).on("pagebeforeshow","#formPage",function(){
GetForms();
});
$(document).on("pageshow","#formPage",function(){
var success = window.localStorage.getItem("SUCCESS");
if(success > 0){
showErrorMessage("Form has been saved and emailed successfully", $("#err"), 3000);
window.localStorage.setItem("SUCCESS","0");
}
});
function GetForms(){
var CID = window.localStorage.getItem("CID");
$.ajax({
type : "POST",
url : "http://app.dslengineering.ca/services/get_forms.php",
async : false,
data : {'CID' : CID},
dataType : "json",
success : function(data) {
$("#historyList").empty().append(data.result);
$('#historyList').listview('refresh');
var name = window.localStorage.getItem("CNAME");
$("#companyName").html(name + ' - ' + data.email);
if(data.count <= 0){
$("#message").html("There are no forms completed for this company.");
}
},
error : function(xhr, desc, err) {
showErrorMessage("Woops! Something went wrong, please try again.", $("#err"), 0);
}
});
}
function GoForm(id,ft){
window.localStorage.setItem("FRID",id);
window.localStorage.setItem("FT",ft);
if(ft == "0"){
window.location= "review.html";
}else if(ft == "1"){
window.location= "review-personnel.html";
}
}
</script>
</div>
</body>
</html>