-
Notifications
You must be signed in to change notification settings - Fork 9
/
ty_add.php
47 lines (38 loc) · 1.21 KB
/
ty_add.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
<?php
require 'config.php';
$name = $_POST['name'];
$grp = $_POST['grp'];
$conn = connection();
$sql = "INSERT INTO type (ty_name, ty_grp)
VALUES ('$name', '$grp')";
$conn->query($sql);
$conn=null;
echo "<span class=\"splash-description\">Measurement Added.</span>";
$conn = connection();
$sql = "SELECT * FROM type t inner join category c on t.ty_grp = c.cat_id order by ty_name ASC";
$data = $conn->query($sql);
$ty_data = "SELECT * FROM type t inner join category c on t.ty_grp = c.cat_id order by ty_name ASC";
$ty_data = $conn->query($ty_data);
$conn=null;
?>
<table class="table table-condensed table-hover table-bordered table-striped">
<thead>
<tr>
<th><center>S. no.</center></th>
<th><center>Measurement Name</center></th>
<th><center>Category</center></th>
<th><center>Category Description</center></th>
</tr>
</thead>
<tbody style="color:black;">
<?php $s=0;
foreach ($ty_data as $row){ $s++; ?>
<tr>
<td><center><?php echo $s; ?></center></td>
<td><?php echo ucwords($row['ty_name']); ?></td>
<td><?php echo ucwords($row['cat_name']); ?></td>
<td><?php echo ucwords($row['cat_des']); ?></td>
</tr>
<?php } ?>
</tbody>
</table>