/
manage_plan.php
257 lines (253 loc) · 11.7 KB
/
manage_plan.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
include("includes/config.inc.php");
include("includes/crosssite.inc.php");
if ( isset ( $_GET['logout'] ) && $_GET['logout'] ==1 ) {
session_destroy();
header("location: index.php?token=".$token);
}
if (isset($_SESSION) && $_SESSION['login']=='')
{
session_destroy();
header("location: index.php?token=".$token);
}
//Delete single record
if(isset($_GET['id'])){
$id = $_GET['id'];
$delete_single_row = "DELETE FROM tblplan WHERE id='$id'";
$delete = mysql_query($delete_single_row);
if($delete){
$msgDanger = "Record Delted Successfully";
}
}
//End
//Delete multiple records
if(isset($_POST['delete_selected'])){
foreach($_POST['linkID'] as $chckvalue){
$sql = "DELETE FROM tblplan WHERE id='$chckvalue'";
$result = mysql_query($sql);
}
if($result){
$msgDanger = "Records Deleted Successfully";
}
}
//end
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?=SITE_PAGE_TITLE?></title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="assets/bootstrap/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="assets/bootstrap/css/ionicons.min.css">
<!-- daterange picker -->
<link rel="stylesheet" href="assets/plugins/daterangepicker/daterangepicker.css">
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="assets/plugins/datepicker/datepicker3.css">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="assets/plugins/iCheck/all.css">
<!-- Bootstrap Color Picker -->
<link rel="stylesheet" href="assets/plugins/colorpicker/bootstrap-colorpicker.min.css">
<!-- Bootstrap time Picker -->
<link rel="stylesheet" href="assets/plugins/timepicker/bootstrap-timepicker.min.css">
<!-- Select2 -->
<link rel="stylesheet" href="assets/plugins/select2/select2.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="assets/dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="assets/dist/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="assets/dist/css/custom.css">
<!-- DataTable CSS -->
<link rel="stylesheet" type="text/css" href="assets/plugins/datatables/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="assets/plugins/datatables/css/buttons.dataTables.min.css">
<script src="assets/bootstrap/js/jquery-1.10.2.js"></script>
<script src="assets/bootstrap/js/jquery-ui.js"></script>
<script type="text/javascript" src="js/checkbox_validation.js"></script>
<script type="text/javascript" src="js/checkbox.js"></script>
<!-- DataTable JS -->
<script type="text/javascript" src="assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/buttons.flash.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/jszip.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/pdfmake.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/vfs_fonts.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="assets/plugins/datatables/js/buttons.print.min.js"></script>
<script type="text/javascript">
$(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
// "bPaginate": false,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
});
</script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<?php include_once("includes/header.php") ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Plan
<!--<small>Control panel</small>-->
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Plan </li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<form name='fullform' method='post' onSubmit="return confirmdelete()">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<div class="row">
<div class="form-group form_custom col-md-12"> <!-- form Custom -->
<div class="row"><!-- row -->
<div class="col-lg-6 col-sm-6 custom_field"> <!-- Custom field -->
<input type='button' name='cancel' class="btn btn-primary btn-sm" value="Add New" onClick="window.location.replace('plan.php?token=<?php echo $token ?>')"/>
<input type="submit" name="delete_selected" onClick="return val();" class="btn btn-primary btn-sm" value="Delete Selected">
</div> <!-- end custom field -->
</div><!-- end row -->
</div><!-- End From Custom -->
</div>
<div class="box box-info">
<div class="box-header">
<!-- <h3 class="box-title">Details</h3> -->
</div>
<div class="box-body">
<div id="dvData" class="table-responsive">
<?php if(isset($msgDanger) && $msgDanger !="") {?>
<div class="alert alert-danger alert-dismissible small-alert" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<?= $msgDanger;?>
</div>
<?php
}
?>
<?php if(isset($_SESSION['sess_msg']) && $_SESSION['sess_msg'] !="") {?>
<div class="alert alert-success alert-dismissible small-alert" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<?= $_SESSION['sess_msg'];?>
</div>
<?php
}
?>
<table id="example" class="table table-hover table-bordered ">
<thead>
<?php
$linkSQL = "select * from tblplan order by plan_name";
$oRS = mysql_query($linkSQL);
?>
<tr>
<th><small>S. No.</small></th>
<th><small>Plan Name</small></th>
<th><small>Description</small></th>
<th><small>Category</small></th>
<th><small>Provider</small></th>
<th><small>Price</small></th>
<th></small>Action
<a href='#' onClick="SetAllCheckBoxes('fullform','linkID[]',true)" style="color:#fff; font-size:11px;">Check All</a>
<a href='#' onClick="SetAllCheckBoxes('fullform','linkID[]',false)" style="color:#fff; font-size:11px;">Uncheck All </a></th>
</tr>
</thead>
<tbody>
<?php
$kolor=1;
if(mysql_num_rows($oRS)>0){
while ($row = mysql_fetch_array($oRS)){
?>
<tr>
<td><small><?php print $kolor++;?>.</small></td>
<td><small>
<?php
if($row["plan_name"] == '')
{
echo 'N/A';
}
else
{
echo stripslashes($row["plan_name"]);
}
?>
</small>
</td>
<td><small>
<?php
if($row["plan_description"] == '')
{
echo 'N/A';
}
else
{
echo stripslashes($row["plan_description"]);
}
?></small>
</td>
<td><?php echo getPlanCategory(stripslashes($row["productCategoryId"]));?></td>
<td><small>
<?php
if($row["serviceprovider_id"] != 0)
{
echo getserviceprovider(stripslashes($row["serviceprovider_id"]));
}
else
{
echo 'N/A';
}
?></small>
</td>
<td><small><?php echo stripslashes($row["plan_rate"]);?></small></td>
<td><small><a href="#" onClick="if(confirm('Do you really want to delete this record?')){ window.location.href='manage_plan.php?id=<?php echo $row["id"]; ?>&type=del&token=<?php echo $token ?>' }" ><img src="images/drop.png" title="Delete" border="0" /></a> <a href="plan.php?id=<?php echo $row["id"] ?>&token=<?php echo $token ?>"><img src='images/edit.png' title='Edit' border='0' /></a> <input type='checkbox' name='linkID[]' value='<?php echo $row["id"]; ?>'></small></td>
</tr>
<?php }
}
?>
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
</div>
</form>
</section> <!-- end main content -->
</div><!-- /.content-wrapper -->
<!-- Loader -->
<div class="loader">
<img src="images/loader.gif" alt="loader">
</div>
<!-- End Loader -->
<?php include_once("includes/footer.php") ?>
</div><!-- ./wrapper -->
<script src="js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="assets/dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="assets/dist/js/demo.js"></script>
<!-- Select2 -->
<script src="assets/plugins/select2/select2.full.min.js"></script>
<script>
$(function () {
//Initialize Select2 Elements
$(".select2").select2();
});
</script>
</body>
</html>