-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
331 lines (315 loc) · 10.5 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
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<?php
include 'header.php';
?>
<link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
<style type="text/css" media="screen">
@media only screen and (max-width: 700px) {
.mobilgizle {
display: none;
}
.mobilgizleexport {
display: none;
}
.mobilgoster {
display: block;
}
}
@media only screen and (min-width: 700px) {
.mobilgizleexport {
display: flex;
}
.mobilgizle {
display: block;
}
.mobilgoster {
display: none;
}
}
</style>
<script type="text/javascript">
var genislik = $(window).width()
if (genislik < 768) {
function yenile(){
$('#sidebarToggleTop').trigger('click');
}
setTimeout("yenile()",1);
}
</script>
<div class="container-fluid p-2">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Müşteriler</h6>
</div>
<div class="card-body" style="width: 100%">
<!--Tablo filtreleme butonları mobilde gizlendiğinde gözükecek buton-->
<div class="table-responsive">
<table class="table table-bordered" id="musteritablosu" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Müşteri Adı</th>
<th>Müşteri Telefon</th>
<th>Müşteri Mail</th>
<th>İşlem</th>
</tr>
</thead>
<!--While döngüsü ile veritabanında ki verilerin tabloya çekilme işlemi giriş-->
<tbody>
<?php
$say=0;
$musterisor=$db->prepare("SELECT * FROM musteri");
$musterisor->execute();
while ($mustericek=$musterisor->fetch(PDO::FETCH_ASSOC)) { $say++?>
<tr>
<td><?php echo $say; ?></td>
<td><?php echo $mustericek['musteri_adi']; ?></td>
<td><?php echo $mustericek['musteri_telefon']; ?></td>
<td><?php echo $mustericek['musteri_mail']; ?></td>
<td>
<div class="d-flex justify-content-center">
<form action="musteriduzenle.php" method="POST">
<input type="hidden" name="musteri_id" value="<?php echo $mustericek['musteri_id'] ?>">
<button type="submit" name="duzenleme" class="btn btn-success btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-edit"></i>
</span>
</button>
</form>
<form class="mx-1" action="islemler/islem.php" method="POST">
<input type="hidden" name="musteri_id" value="<?php echo $mustericek['musteri_id'] ?>">
<button type="submit" name="musterisilme" class="btn btn-danger btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-trash"></i>
</span>
</button>
</form>
<form action="musteri" method="POST">
<input type="hidden" name="musteri_id" value="<?php echo $mustericek['musteri_id'] ?>">
<button type="submit" name="musteri_bak" class="btn btn-primary btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-eye"></i>
</span>
</button>
</form>
</div>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>No</th>
<th>Müşteri Adı</th>
<th>Müşteri Yetkilisi</th>
<th>Müşteri Telefon</th>
<th>Müşteri Mail</th>
</tr>
</tfoot>
<!--While döngüsü ile veritabanında ki verilerin tabloya çekilme işlemi çıkış-->
</table>
</div>
</div>
</div>
<hr>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Domainler</h6>
</div>
<div class="card-body" style="width: 100%">
<!--Tablo filtreleme butonları mobilde gizlendiğinde gözükecek buton-->
<div class="table-responsive">
<table class="table table-bordered" id="domaintablosu" width="100%" cellspacing="0">
<thead>
<tr>
<th>No</th>
<th>Domain Adı</th>
<th>Domain Müşteri</th>
<th>Domain Bitiş</th>
<th>Kalan Gün Sayısı</th>
<th>İşlem</th>
</tr>
</thead>
<!--While döngüsü ile veritabanında ki verilerin tabloya çekilme işlemi giriş-->
<tbody>
<?php
$say=0;
$domainsor=$db->prepare("SELECT * FROM domain");
$domainsor->execute();
while ($domaincek=$domainsor->fetch(PDO::FETCH_ASSOC)) { $say++?>
<tr>
<td><?php echo $say; ?></td>
<td><?php echo $domaincek['domain_adi']; ?></td>
<td><?php
$musterisor=$db->prepare("SELECT * FROM musteri WHERE musteri_id=:musteri_id");
$musterisor->execute(array(
'musteri_id' => $domaincek['domain_musteri']
));
$mustericek=$musterisor->fetch(PDO::FETCH_ASSOC);
echo $mustericek['musteri_adi'];
?></td>
<td><?php echo $domaincek['domain_bitis']; ?></td>
<td><?php
$tarih1 = strtotime(date('d.m.Y'));
$tarih2 = strtotime($domaincek['domain_bitis']);
$fark = $tarih2 - $tarih1;
echo $sonuc = floor($fark / (60 * 60 * 24));
?></td>
<td>
<div class="d-flex justify-content-center">
<form class="mr-1" action="yenile.php" method="POST">
<input type="hidden" name="domain_id" value="<?php echo $domaincek['domain_id'] ?>">
<button type="submit" name="yenile" class="btn btn-info btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-sync-alt"></i>
</span>
</button>
</form>
<form action="domainduzenle.php" method="POST">
<input type="hidden" name="domain_id" value="<?php echo $domaincek['domain_id'] ?>">
<button type="submit" name="duzenleme" class="btn btn-success btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-edit"></i>
</span>
</button>
</form>
<form class="mx-1" action="islemler/islem.php" method="POST">
<input type="hidden" name="domain_id" value="<?php echo $domaincek['domain_id'] ?>">
<button type="submit" name="domainsilme" class="btn btn-danger btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-trash"></i>
</span>
</button>
</form>
<form action="domain" method="POST">
<input type="hidden" name="domain_id" value="<?php echo $domaincek['domain_id'] ?>">
<button type="submit" name="domain_bak" class="btn btn-primary btn-sm btn-icon-split">
<span class="icon text-white-60">
<i class="fas fa-eye"></i>
</span>
</button>
</form>
</div>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>No</th>
<th>Plaka</th>
<th>Şase No</th>
<th>Müşteri İsim</th>
<th>Kalan Gün Sayısı</th>
</tr>
</tfoot>
<!--While döngüsü ile veritabanında ki verilerin tabloya çekilme işlemi çıkış-->
</table>
</div>
</div>
</div>
</div>
<!--Projeler Çıkış-->
</div>
<?php
include 'footer.php';
?>
<script src="vendor/datatables/jquery.dataTables.min.js"></script>
<script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>
<script src="js/demo/datatables-demo.js"></script>
<script src="vendor/datatables/dataTables.buttons.min.js"></script>
<script src="vendor/datatables/buttons.flash.min.js"></script>
<script src="vendor/datatables/jszip.min.js"></script>
<script src="vendor/datatables/pdfmake.min.js"></script>
<script src="vendor/datatables/vfs_fonts.js"></script>
<script src="vendor/datatables/buttons.html5.min.js"></script>
<script src="vendor/datatables/buttons.print.min.js"></script>
<script type="text/javascript">
$("#aktarmagizleme").click(function(){
$(".dt-buttons").toggle();
});
</script>
<script type="text/javascript">
$(".mobilgoster").click(function(){
$(".gizlemeyiac").toggle();
});
</script>
<script>
var dataTables = $('#musteritablosu').DataTable({
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
});
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
});
});
},
"ordering": true, //Tabloda sıralama özelliği gözüksün mü? true veya false
"searching": true, //Tabloda arama yapma alanı gözüksün mü? true veya false
"lengthChange": true, //Tabloda öğre gösterilme gözüksün mü? true veya false
"info": true,
"lengthMenu": [ 5, 10, 25, 50, 75, 100 ],
dom: "<'row '<'col-md-6'l><'col-md-6'f><'col-md-4 d-none d-print-block'B>>rtip",
});
</script>
<script>
var dataTables = $('#domaintablosu').DataTable({
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
});
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
});
});
},
"ordering": true, //Tabloda sıralama özelliği gözüksün mü? true veya false
"searching": true, //Tabloda arama yapma alanı gözüksün mü? true veya false
"lengthChange": true, //Tabloda öğre gösterilme gözüksün mü? true veya false
"info": true,
"lengthMenu": [ 5, 10, 25, 50, 75, 100 ],
dom: "<'row '<'col-md-6'l><'col-md-6'f><'col-md-4 d-none d-print-block'B>>rtip",
});
</script>
<?php
if (isset($_GET['durum'])) {?>
<?php if ($_GET['durum']=="izinsiz") {?>
<script>
Swal.fire({
type: 'error',
title: 'İzniniz Yok',
text: 'Girme İzniniz olmayan bir alana girmeye çalıştınız',
showConfirmButton: false,
timer: 2000
})
</script>
<?php } ?>
<?php if ($_GET['durum']=="ok") {?>
<script>
Swal.fire({
type: 'success',
title: 'İşlem Başarılı',
text: 'İşleminiz Başarıyla Gerçekleştirildi',
showConfirmButton: false,
timer: 2000
})
</script>
<?php } } ?>