-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
189 lines (170 loc) · 8.37 KB
/
index.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Include meta tag to ensure proper rendering and touch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Include jQuery Mobile stylesheets -->
<link href="css/themes/Color.css" rel="stylesheet" />
<link href="css/themes/jquery.mobile.icons.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css">
<!-- Include the jQuery library -->
<script src="js/jquery-1.11.3.min.js"></script>
<!-- Include the jQuery Mobile library -->
<script src="js/jquery.mobile-1.4.5.min.js"></script>
<style>
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: #e0dada;
}
</style>
</head>
<body>
<div data-role="page" id="pageone" data-theme="c">
<div data-role="header">
<h1>Welcome to ISecure App</h1>
<div data-role="navbar">
<ul>
<li><a href="#" data-icon="home">Home</a></li>
<li><a href="iReached.html" rel="external" data-transition="slidefade" data-icon="search">IReached</a></li>
</ul>
</div>
<a href="#myPopup" data-rel="popup" class="ui-btn ui-icon-info ui-btn-icon-right ui-btn-icon-notext ui-corner-all">With circle (default)</a>
<div data-role="popup" id="myPopup" class="ui-content">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-left">Close</a>
<p>This app for tracking the childern.</p>
<p><b>Tip:</b> Please add the emergency number to secure your childern.</p>
</div>
</div>
<div data-role="main" class="ui-content">
<label for="username">username:</label>
<input class="required" type="text" name="username" id="username" />
<label for="password">Password:</label>
<input class="required" type="password" name="password" id="password">
<input type="submit" value="Login" id="submitButton">
<br />
<!--<input id="number" placeholder="Enter mobile number" value="" type="tel" />
<textarea id="message" placeholder="Enter message"></textarea>
<input type="button" class="btn btn-positive btn-block" id="sendMessage" value="Send Message">-->
<a href="#dialogEmergency" id="showDialog" style="display:none;" data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-plus ui-btn-icon-left ui-btn-c" data-position-to="window"> Show</a>
<div data-role="popup" id="dialogEmergency">
<a href="#" data-role="button" data-theme="a" data-rel="back" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
<div data-role="header">
<h1>Information</h1>
</div>
<div data-role="main" class="ui-content">
<p>Do you want to send the SMS?</p>
<textarea class="required" rows="3" cols="10" style="display:none;" name="txtReason" id="txtReason" placeholder="Enter your reason" ></textarea>
<a href="#" onclick="SendSMS()" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-check ui-btn-icon-left ui-btn-c" id="btnYes">Yes</a>
<a onclick="NoSMSSend()" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-delete ui-btn-icon-left ui-btn-c" id="btnViewAllTheft">
No
</a>
</div>
</div>
</div>
<div data-role="footer" data-position="fixed">
<h1>@Copyright 2019 - Imran Asif</h1>
</div>
</div>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=geometry"></script>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="js/appSpyEye.js"></script>
<script>
$(document).ready(function () {
var createStatement = "CREATE TABLE IF NOT EXISTS app_admin (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT, password TEXT)";
var insertStatement = "INSERT INTO app_admin (username, password) VALUES (?, ?)";
var selectStatement = "Select * from app_admin where username = ? and password = ?";
var selectStatementAll = "Select * from app_admin";
var dropStatement = "DROP TABLE app_admin";
var db = openDatabase("SecureDb", "1.0", "App I Secure", 200000); // Open SQLite Database
var dataset;
var DataType;
var success;
function dropTable() // Function Call when Drop Button Click.. Talbe will be dropped from database.
{
db.transaction(function (tx) { tx.executeSql(dropStatement, [], null, onError); });
}
function initDatabase() // Function Call When Page is ready.
{
try {
if (!window.openDatabase) // Check browser is supported SQLite or not.
{
ShowMessage('Databases are not supported in this mobile.');
}
else {
// alert('db Initialized.')
createTable(); // If supported then call Function for create table in SQLite
}
}
catch (e) {
if (e == 2) {
// Version number mismatch.
ShowMessage("Invalid database version.");
} else {
ShowMessage("Unknown error " + e + ".");
}
return;
}
}
function insertRecord() {
db.transaction(function (tx) {
tx.executeSql(insertStatement, ['admin', 'admin'], onSuccess, onError);
});
}
initDatabase(); // call to initialize database
//insertRecord();
function ShowAll() {
db.transaction(function (tx) {
tx.executeSql(selectStatementAll, [], function (tx, result) {
dataset = result.rows;
if (dataset.length == 0) {
insertRecord();
}
});
});
}
ShowAll();
function Authenticate() {
db.transaction(function (tx) {
tx.executeSql(selectStatement, [$('#username').val(), $('#password').val()], function (tx, result) {
dataset = result.rows;
if (dataset.length == 0) {
ShowMessage("Username/password is incorrect.");
}
else {
ShowMessage("Authenticated");
$.mobile.changePage("admin.html", { transition: "slideup", changeHash: false });
}
});
});
}
$('#submitButton').click(function () {
Authenticate();
});
function onError(tx, error) // Function for Hendeling Error...
{
ShowMessage("dbError: " + error.message);
}
function onSuccess(tx, error) // Function for Hendeling Success...
{
ShowMessage('updated successfully.');
}
function createTable() // Function for Create Table in SQLite.
{
db.transaction(function (tx) { tx.executeSql(createStatement, [], null, onError); });
}
///// Message function
function ShowMessage(message) {
$.mobile.loading('show',
{
theme: "a", text: (message),
textonly: true, textVisible: true
});
setTimeout(function () {
$.mobile.loading('hide');
}, 2000);
}
});
</script>
</body>
</html>