-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomerprofile.php
173 lines (156 loc) · 6.05 KB
/
customerprofile.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
<?php
$connect = mysqli_connect('localhost','root',"",'cartsystem');
$query = "SELECT * FROM users";
$result = mysqli_query($connect, $query);
?>
<!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,shrink-to-fit=no">
<title>Customer Profile</title>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<style>
header {
background-image: url('image/bake1.png');
background-repeat: no-repeat;
background-size: initial;
background-position: center;
height: 150px;
position: relative;
}
.content-table {
border-collapse: collapse;
margin: 25px 0;
font-size:1.5em;
min-width: 400px;
font-weight: bold;
border-radius: 5px 5px 0 0 ;
overflow: hidden;
box-shadow: 0 0 20px rgba(0,0,0,0.15);
}
.content-table th {
background-color: lightsalmon;
color: white;
padding: 12px 15px;
}
.content-table td {
padding: 12px 15px;
}
.content-table tbody tr {
border-bottom: 1px solid #dddddd;
}
.content-table tbody tr:nth-of-type(even) {
background-color: #f3f3f3;
}
.content-table tbody tr:last-of-type {
border-bottom: 2px solid lightsalmon;
}
tr td:first-child {
width: 300px;
}
tr td:nth-child(2) {
width: 620px;
}
tr td:nth-child(3) {
width: 200px;
}
</style>
</head>
<body>
<img src="image/bbtea.png" style="position:fixed; right:1240px; bottom:150px; width:400px; height:430px; border:none;">
<img src="image/bbtea1.png" style="position:fixed; right:120px; bottom:150px; width:380px; height:420px; border:none;">
<header>
<?php include("header1.php"); ?>
</header>
<div class="container" style="width:600px;">
</br></br>
<h1 align="center">Customer Details & Database</h1>
<div class="form-inline">
<label for="search" class="font-weight-bold lead text-dark">
Search Record </label>
<input type="text" name="search" id="search_text" class="
form-control form-control-lg rounded-0 border-primary" placeholder="Search with ID or Name">
</div>
<div class="table-responsive">
<table id="table-data" class="content-table">
<thead>
<tr>
<th>Customer ID</th>
<th>Customer Name</th>
<th>Details</th>
</tr>
</thead>
<?php
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["id"]; ?></td>
<td><?php echo $row["username"]; ?></td>
<td><input type="button" name="view" value="VIEW" id="<?php echo $row["id"]; ?>" class="btn btn-info btn view_data" /></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
<div id="dataModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 align="center" class="modal-title">Customer Details</h4>
</div>
<div class="modal-body" id="customer_name">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#search_text").keyup(function(){
var search = $(this).val();
$.ajax({
url:'action1.php',
method: 'post',
data:{query:search},
success:function(response){
$("#table-data").html(response);
}
});
});
});
</script>
<script>
$(document).ready(function(){
$('.view_data').click(function(){
var customer_id = $(this).attr("id");
$.ajax({
url:"select.php",
method:"post",
data:{customer_id:customer_id},
success:function(data){
$('#customer_name').html(data);
$('#dataModal').modal("show");
}
});
});
});
</script>
</body>
</html>