-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtable_try.php
More file actions
91 lines (88 loc) · 2.39 KB
/
table_try.php
File metadata and controls
91 lines (88 loc) · 2.39 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
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
<?php
$mysqli = new mysqli("127.0.0.1", "root", "", "dbms");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
//$result= $conn->query("SELECT SUM(Total_Steps) AS value_sum FROM users");
//$selectSQL = 'SELECT * FROM `customer`';
# Execute the SELECT Query
?>
<head>
<title>Details In Table</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background-color:#e0e0e0;">
<div class="container">
<h2>Customer Details</h2>
<table class="table table-striped" border="2">
<thead>
<tr>
<th>id</th>
<th>Name</th>
<th>Mobile number</th>
</tr>
</thead>
<tbody>
<?php
$result= $mysqli->query("SELECT * FROM customer");
while($row = $result->fetch_assoc()){
echo "<tr><td>{$row['id']}</td><td>{$row['name']}</td><td>{$row['mobileno']}</td></tr>\n";
}
?>
</tbody>
</table>
</div>
<!--Stock details-->
<div class="container">
<h2>Stocks</h2>
<table class="table table-striped" border="2">
<thead>
<tr>
<th>id</th>
<th>Name</th>
<th>Quantity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<?php
$result= $mysqli->query("SELECT * FROM stock");
while($row = $result->fetch_assoc()){
echo "<tr><td>{$row['id']}</td><td>{$row['name']}</td><td>{$row['quantityinstock']}</td><td>{$row['price']}</td></tr>\n";
}
?>
</tbody>
</table>
</div>
<!--Selling details-->
<div class="container">
<h2>Selling Details</h2>
<table class="table table-striped" border="2">
<thead>
<tr>
<th>Bill no.</th>
<th>Customer Id</th>
<th>Item</th>
<th>Quantity</th>
<th>Total Amount</th>
<th>Paid Amounnt</th>
<th>Buying Date</th>
</tr>
</thead>
<tbody>
<?php
$result= $mysqli->query("SELECT * FROM customerstock");
while($row = $result->fetch_assoc()){
echo "<tr><td>{$row['bill_no']}</td><td>{$row['customer_id']}</td><td>{$row['stock_name']}</td><td>{$row['quantity']}</td><td>{$row['total_amount']}</td><td>{$row['paid_amount']}</td><td>{$row['buying_date']}</td></tr>\n";
}
?>
</tbody>
</table>
</div>
</body>