-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
178 lines (170 loc) · 9.92 KB
/
index.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
<?php
session_start();
if (!isset($_SESSION['username'])) {
header('Location: login.php');
exit();
}
$username = $_SESSION['username'];
$role = $_SESSION['role'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kumar Cables Service & Fibre Internet</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Kumar Cables Service & Fibre Internet</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<span class="navbar-text">Welcome, <?php echo $username; ?></span>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="notificationDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-bell"></i> <span class="badge badge-danger" id="notificationCount"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="notificationDropdown" id="notificationList">
<!-- Notification items will be dynamically populated here -->
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout</a>
</li>
</ul>
</div>
</nav>
<div class="container my-4">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header bg-primary text-white">
<h5 class="card-title mb-0">Bills</h5>
</div>
<div class="card-body">
<div class="mb-3">
<button class="btn btn-primary" id="addBillBtn">Add Bill</button>
<button class="btn btn-secondary ml-2" id="billListBtn">Bill List</button>
<button class="btn btn-info float-right" id="exportBtn">Export</button>
</div>
<div id="addBillForm" style="display: none;">
<h4>Add Bill</h4>
<form>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" required>
<div class="invalid-feedback">Please enter a name.</div>
</div>
<div class="form-group">
<label for="caid">CAID:</label>
<input type="text" class="form-control" id="caid" required>
<div class="invalid-feedback">Please enter a CAID.</div>
</div>
<div class="form-group">
<label for="opDbm">OP DBM:</label>
<input type="text" class="form-control" id="opDbm" required>
<div class="invalid-feedback">Please enter an OP DBM.</div>
</div>
<div class="form-group">
<label for="payDate">Pay Date:</label>
<input type="date" class="form-control" id="payDate" required>
<div class="invalid-feedback">Please select a pay date.</div>
</div>
<div class="form-group">
<label for="nextDueDate">Next Due Date:</label>
<input type="date" class="form-control" id="nextDueDate" required>
<div class="invalid-feedback">Please select a next due date.</div>
</div>
<div class="form-group">
<label for="price">Price:</label>
<input type="number" class="form-control" id="price" required>
<div class="invalid-feedback">Please enter a price.</div>
</div>
<button type="submit" class="btn btn-primary">Save Bill</button>
</form>
</div>
<div id="billList" style="display: none;">
<h4>Bill List</h4>
<div class="filter-container">
<div class="form-group">
<label for="filterBills">Filter by:</label>
<select class="form-control" id="filterBills">
<option value="name">Name</option>
<option value="caid">CAID</option>
</select>
</div>
<div class="form-group">
<label for="filterValue">Filter Value:</label>
<input type="text" class="form-control" id="filterValue">
</div>
<div class="form-group">
<label for="startDate">Start Date:</label>
<input type="date" class="form-control" id="startDate">
</div>
<div class="form-group">
<label for="endDate">End Date:</label>
<input type="date" class="form-control" id="endDate">
</div>
<button class="btn btn-primary" id="sortByDueDate">Sort by Due Date</button>
</div>
<button class="btn btn-secondary" id="generateInvoiceBtn">Generate Invoice</button>
<table class="table table-striped">
<thead>
<tr>
<th>S.No</th>
<th>Name</th>
<th>CAID</th>
<th>OP DBM</th>
<th>Action</th>
</tr>
</thead>
<tbody id="billTableBody">
</table>
</div>
<div id="addPaymentForm" style="display: none;">
<h4>Add Payment</h4>
<form id="paymentForm">
<input type="hidden" id="paymentCaid">
<input type="hidden" id="paymentName">
<div class="form-group">
<label for="paymentDate">Payment Date:</label>
<input type="date" class="form-control" id="paymentDate" required>
<div class="invalid-feedback">Please select a payment date.</div>
</div>
<div class="form-group">
<label for="paymentNextDueDate">Next Due Date:</label>
<input type="date" class="form-control" id="paymentNextDueDate" required>
<div class="invalid-feedback">Please select a next due date.</div>
</div>
<div class="form-group">
<label for="paymentPrice">Price:</label>
<input type="number" class="form-control" id="paymentPrice" required>
<div class="invalid-feedback">Please enter a price.</div>
</div>
<button type="submit" class="btn btn-primary">Save Payment</button>
<button type="button" class="btn btn-secondary" id="cancelPaymentBtn">Cancel</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.16.9/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="script.js"></script>
<script>
var userRole = '<?php echo $role; ?>';
</script>
</body>
</html>