Update Voucher , Tiket , Dashboard
membuat perubahan dan update
This commit is contained in:
+68
-49
@@ -22,63 +22,82 @@
|
||||
<div class="card-body">
|
||||
<table id="example1" class="table table-bordered table-striped">
|
||||
<thead class="bg-warning">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Time</th>
|
||||
<th>Nama Server</th>
|
||||
<th>Jenis</th>
|
||||
<th>Keterangan</th>
|
||||
<th>Lokasi</th>
|
||||
<th>Koordinat</th>
|
||||
<th>URL Tracking</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Time</th>
|
||||
<th>Nama Server</th>
|
||||
<th>Jenis</th>
|
||||
<th>Keterangan</th>
|
||||
<th>Lokasi</th>
|
||||
<th>Koordinat</th>
|
||||
<th>URL Tracking</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
<?php
|
||||
$no = 1;
|
||||
$aserver = mysqli_query($con,"SELECT * FROM v_tiket_gangguan WHERE status = '1' $SqlDataId");
|
||||
while ($server = mysqli_fetch_assoc($aserver)) {
|
||||
$stmt = $pdo->query("SELECT * FROM v_tiket_gangguan WHERE status = '1' $SqlDataId ORDER BY level");
|
||||
while ($server = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($server['jenis_tiket'] == 'Pelanggan') {
|
||||
$ket = '<a href="?'.encrypt_url('user_detail|'.$server['id_pelanggan']).'"><b>'.$server['nama_pelanggan'].'</b></a><br>'.$server['permasalahan'];
|
||||
} else {
|
||||
$ket = $server['permasalahan'];
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td style="max-width: 30px;"><?php echo $no; ?></td>
|
||||
<td style="max-width: 75px;"><?php echo $server['start_time']; ?></td>
|
||||
<td><?php echo $server['nama_server']; ?></td>
|
||||
<td><?php echo $server['jenis_tiket']; ?></td>
|
||||
<td style="max-width: 150px;"><?php echo $ket; ?></td>
|
||||
<td style="max-width: 150px;"><?php echo $server['lokasi']; ?></td>
|
||||
<td style="max-width: 150px;"><a href="https://www.google.com/maps/search/?api=1&query=<?php echo $server['latitude'].', '.$server['longitude']; ?>" target="_blank"><?php echo $server['latitude'].', '.$server['longitude']; ?></a></td>
|
||||
<td style="max-width: 150px;"><a href="<?= 'https://manjapro.net/tracking/' . $server['tiket_id']; ?>" target="_blank"><?= 'https://manjapro.net/tracking/' . $server['tiket_id']; ?></a></td>
|
||||
<td>
|
||||
<form method="post">
|
||||
<?php if(in_array("Ubah", $json_array[36]['sub_menu'])) { ?>
|
||||
<input type="submit" name="proses<?php echo $server['id'];?>" value="Proses Tiket" class="btn btn-primary btn-sm ml-1" />
|
||||
<?php } if(in_array("Hapus", $json_array[36]['sub_menu'])) { ?>
|
||||
<input type="submit" name="hapus<?php echo $server['id'];?>" value="Hapus" class="btn btn-danger btn-sm ml-1" />
|
||||
<?php } ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if (isset($_POST['proses'.$server['id']])) {
|
||||
$waktu = date('Y-m-d H:i:s');
|
||||
$stmt = $pdo->prepare("UPDATE tiket_gangguan SET id_penyelesai_tiket = :idpenyet, sebelum_proses_time = :waktu, status = '2' WHERE id = :idtik");
|
||||
$stmt->bindParam(':waktu', $waktu);
|
||||
$stmt->bindParam(':idpenyet', $UserId, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':idtik', $server['id'], PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
sweetAlert("Tiket akan di proses", "success", "?".encrypt_url('tiket_proses'));
|
||||
}
|
||||
if (isset($_POST['hapus'.$server['id']])) {
|
||||
$iddata = $server['id'];
|
||||
deleteAlert("tiket_gangguan", $iddata);
|
||||
}
|
||||
$no++; } ?>
|
||||
|
||||
// Tentukan warna garis berdasarkan level
|
||||
if ($server['level'] == 1) {
|
||||
$borderColor = '#dc3545'; // Bootstrap danger
|
||||
} elseif ($server['level'] == 2) {
|
||||
$borderColor = '#ffc107'; // Bootstrap warning
|
||||
} else {
|
||||
$borderColor = '#0dcaf0'; // Bootstrap info
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="align-middle" style="border-left: 8px solid <?php echo $borderColor; ?>;">
|
||||
<?php echo $no; ?>
|
||||
</td>
|
||||
<td style="max-width: 75px;"><?php echo $server['start_time']; ?></td>
|
||||
<td><?php echo $server['nama_server']; ?></td>
|
||||
<td><?php echo $server['jenis_tiket']; ?></td>
|
||||
<td style="max-width: 150px;"><?php echo $ket; ?></td>
|
||||
<td style="max-width: 150px;"><?php echo $server['lokasi']; ?></td>
|
||||
<td style="max-width: 150px;">
|
||||
<a href="https://www.google.com/maps/search/?api=1&query=<?php echo $server['latitude'].','.$server['longitude']; ?>" target="_blank">
|
||||
<?php echo $server['latitude'].', '.$server['longitude']; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td style="max-width: 150px;">
|
||||
<a href="<?= 'https://manjapro.net/tracking/' . $server['tiket_id']; ?>" target="_blank">
|
||||
<?= 'https://manjapro.net/tracking/' . $server['tiket_id']; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post">
|
||||
<?php if (in_array("Ubah", $json_array[36]['sub_menu'])) { ?>
|
||||
<input type="submit" name="proses<?php echo $server['id'];?>" value="Proses Tiket" class="btn btn-primary btn-sm mb-1" />
|
||||
<?php } if (in_array("Hapus", $json_array[36]['sub_menu'])) { ?>
|
||||
<input type="submit" name="hapus<?php echo $server['id'];?>" value="Hapus" class="btn btn-danger btn-sm" />
|
||||
<?php } ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if (isset($_POST['proses'.$server['id']])) {
|
||||
$waktu = date('Y-m-d H:i:s');
|
||||
$stmt2 = $pdo->prepare("UPDATE tiket_gangguan SET id_penyelesai_tiket = :idpenyet, sebelum_proses_time = :waktu, status = '2' WHERE id = :idtik");
|
||||
$stmt2->bindParam(':waktu', $waktu);
|
||||
$stmt2->bindParam(':idpenyet', $UserId, PDO::PARAM_INT);
|
||||
$stmt2->bindParam(':idtik', $server['id'], PDO::PARAM_INT);
|
||||
$stmt2->execute();
|
||||
sweetAlert("Tiket akan di proses", "success", "?".encrypt_url('tiket_proses'));
|
||||
}
|
||||
if (isset($_POST['hapus'.$server['id']])) {
|
||||
$iddata = $server['id'];
|
||||
deleteAlert("tiket_gangguan", $iddata);
|
||||
}
|
||||
$no++; } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user