-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfirm.php
155 lines (147 loc) · 5.37 KB
/
firm.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
<?php
session_start();
require 'config.php';
$conn = connection();
$sql = "SELECT * FROM firm ORDER BY firm_name ASC";
$data = $conn->query($sql);
$conn=null;
?>
<div id="form-bp1" tabindex="-1" role="dialog" class="modal fade colored-header colored-header-dark">
<div class="modal-dialog custom-width" style="height:200px;">
<div class="modal-content">
<div class="modal-header" style="background-color: #00796B;">
<h3 class="modal-title"><strong>ADD NEW FIRM</strong></h3>
</div>
<div class="modal-body">
<div class="form-group">
<label>Firm Name</label>
<input type="text" placeholder="enter firm name" id="firm_name" class="form-control input-xs parsley-error" required="required">
</div>
<div class="form-group">
<label>Firm Description</label>
<input type="text" placeholder="enter firm description" id="firm_des" class="form-control input-xs parsley-error" required="required">
</div>
<div class="form-group">
<label>Phone number</label>
<input type="number" placeholder="enter phone number" id="firm_no" class="form-control input-xs parsley-error" required="required">
</div>
<div class="form-group">
<label>Address</label>
<input type="text" placeholder="enter firm address" id="firm_add" class="form-control input-xs parsley-error" required="required">
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default md-close">Cancel</button>
<button type="submit" onclick="add_firm();" data-dismiss="modal" class="btn btn-dark md-close">Proceed</button>
</div>
</div>
</div>
</div>
<!-- MODAL CLOSE -->
<div class="col-md-12">
<div class="col-md-12">
<div class="panel panel-full-color panel-primary">
<div class="panel-heading panel-heading-contrast" style="background-color: #009688;"><strong>FIRM DETAILS</strong>
<div class="tools"><span class="icon mdi"></span></div><span class="panel-subtitle"></span>
</div>
<div class="panel-body" style="background-color: #00796B;">
<div class="col-md-3">
<label class="control-label panel-subtitle" style="color:white;font-size:20px;">Search by Name</label>
<input type="text" value="" placeholder="Enter Name..." id="sfirm_name" onkeyup="srch_firm();" class="form-control input-xs">
</div>
<div class="col-md-3">
<label class="control-label "> </label><br>
<div class="btn-group btn-space">
<button data-toggle="modal" data-target="#form-bp1" class="btn btn-space md-trigger btn-danger"><i class="icon icon-left mdi mdi-store"></i> ADD FIRM</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default panel-table">
<div class="panel-heading text-center"><strong>FIRM TABLE</strong>
</div>
<div class="panel-body">
<span id="srch_firm">
<table class="table table-condensed table-hover table-bordered table-striped">
<thead>
<tr>
<th><center>S. no.</center></th>
<th><center>Name</center></th>
<th><center>Description</center></th>
<th><center>Phone</center></th>
<th><center>Address</center></th>
</tr>
</thead>
<tbody style="color:black;">
<?php $s=0;
foreach ($data as $row){ $s++; ?>
<tr>
<td><center><?php echo $s; ?></center></td>
<td><?php echo ucwords($row['firm_name']); ?></td>
<td><?php echo ucwords($row['firm_des']); ?></td>
<td><?php echo ucwords($row['firm_no']); ?></td>
<td><?php echo ucwords($row['firm_add']); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</span>
</div>
</div>
</div>
</div>
<script>
function callPro(id)
{
var pro = id;
// alert(id);
$.ajax({
type: "POST",
url: 'nav.php',
data: {pro:pro},
success:function(msg) {
// alert(msg);
$('#output').html(msg);
}
});
}
</script>
<script>
function add_firm()
{
var name = $('#firm_name').val();
var des = $('#firm_des').val();
var phone = $('#firm_no').val();
var address = $('#firm_add').val();
// var grp = $('#firm_grp').val();
// alert(phone);
// alert(address);
$.ajax({
type: "POST",
url: 'firm_add.php',
data: {name:name,des:des,phone:phone,address:address},
success:function(msg) {
// alert(msg);
$('#srch_firm').html(msg);
}
});
}
</script>
<script>
function srch_firm()
{
var name = $('#sfirm_name').val();
// alert(name);
$.ajax({
type: "POST",
url: 'srch_firm.php',
data: {name:name},
success:function(msg) {
// alert(msg);
$('#srch_firm').html(msg);
}
});
}
</script>