-
Notifications
You must be signed in to change notification settings - Fork 2
/
user.php
231 lines (189 loc) · 8.2 KB
/
user.php
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?php
include_once('api/Objects/functions.php');
include_once('api/Objects/Driver.php');
$Driver = new Driver();
$Driver->AadharId = $_GET['ai'];
$DriverDetails = $Driver->getDriver();
$Linked = false;
//print_r($DriverDetails);
if(isset($_GET['UserId'])){
$user = new User();
$user->AddUserWithDriver($DriverDetails[0]['driver_id'], $_GET['UserId']);
$Linked = true;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>user</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="css/stylesheet.css" rel="stylesheet">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script
src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ngStorage/0.3.6/ngStorage.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body ng-app="UserApp" ng-controller="UserCtrl">
<div class="container">
<div class="row">
<div class="col-md-5 toppad pull-right col-md-offset-3 ">
<A href="" >Edit Profile</A>
<A href="" >USERName</A>
<br>
<p class=" text-info">May 05,2014,03:00 pm </p>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 toppad" >
<?php
if($Linked){
?>
<div class="alert alert-info">
You are now linked with this driver
</div>
<?php
}
?>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Driver's Information</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3 col-lg-3 " align="center"> <img alt="User Pic" src="data:image/png;base64,<?php echo $DriverDetails[0]['photo'] ?>" class="img-circle img-responsive"> </div>
<div class=" col-md-9 col-lg-9 ">
<table class="table table-user-information">
<tbody>
<tr>
<td style="text-align: right">Driver Name:</td>
<td style="text-align: left"><?php echo $DriverDetails[0]['name'] ?></td>
</tr>
<tr>
<td style="text-align: right">Aadhar ID:</td>
<td style="text-align: left"><?php echo $DriverDetails[0]['aadhar_id'] ?></td>
</tr>
<tr>
<td style="text-align: right">Date of Birth</td>
<td style="text-align: left"><?php echo $DriverDetails[0]['dob'] ?></td>
</tr>
<tr>
<tr>
<td style="text-align: right">Gender</td>
<td style="text-align: left"><?php echo $DriverDetails[0]['gender'] ?></td>
</tr>
<tr>
<td style="text-align: right">Home Address</td>
<td style="text-align: left"><?php echo $DriverDetails[0]['address'] ?></td>
</tr>
</tbody>
</table>
<a href="#" class="btn btn-primary">Drivers Police Record</a>
<a href="#" class="btn btn-primary">Contact Us</a>
</div>
</div>
</div>
<div class="panel-footer">
<span class="pull-right">
<a href="edit.html" data-original-title="Edit this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-warning"><i class="glyphicon glyphicon-edit"></i></a>
<a data-original-title="Remove this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-remove"></i></a>
</span>
<a data-text="Hi! i am travelling, this is the details of driver's profile" data-link="<?php echo "http://".$_SERVER['SERVER_ADDR']."/IRIS_APP/user.php?ai=".$_GET['ai'] ?>" class="whatsapp w3_whatsapp_btn w3_whatsapp_btn_large">Share</a>
</div>
</div>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
$(document).on("click", '.whatsapp', function() {
if( isMobile.any() ) {
var text = $(this).attr("data-text");
var url = $(this).attr("data-link");
var message = encodeURIComponent(text) + " - " + encodeURIComponent(url);
var whatsapp_url = "whatsapp://send?text=" + message;
window.location.href = whatsapp_url;
} else {
alert("Please share this article in mobile device");
}
});
});
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</body>
<script>
var UserApp = angular.module("UserApp",['ngStorage']);
UserApp.controller('UserCtrl',function($http, $scope, $timeout, $window, $localStorage, $sessionStorage){
$scope.$storage = $localStorage;
console.log($scope.$storage);
<?php
if(!isset($_GET['UserId'])){
?>
$window.location.href = "http://<?php echo $_SERVER['SERVER_ADDR']?>/IRIS_APP/user.php?ai=<?php echo $_GET['ai']?>&UserId="+$scope.$storage.userId;
<?php
}
?>
});
</script>
</html>
<!--$(document).ready(function() {
var panels = $('.user-infos');
var panelsButton = $('.dropdown-user');
panels.hide();
//Click dropdown
panelsButton.click(function() {
//get data-for attribute
var dataFor = $(this).attr('data-for');
var idFor = $(dataFor);
//current button
var currentButton = $(this);
idFor.slideToggle(400, function() {
//Completed slidetoggle
if(idFor.is(':visible'))
{
currentButton.html('<i class="glyphicon glyphicon-chevron-up text-muted"></i>');
}
else
{
currentButton.html('<i class="glyphicon glyphicon-chevron-down text-muted"></i>');
}
})
});
$('[data-toggle="tooltip"]').tooltip();
$('button').click(function(e) {
e.preventDefault();
alert("This is a demo.\n :-)");
});
});-->