update baru apk manjapro
This commit is contained in:
+179
-4
@@ -19,11 +19,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<table id="example1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Order Time</th>
|
||||
<th>Nama</th>
|
||||
<th>Alamat</th>
|
||||
@@ -33,25 +35,51 @@
|
||||
<th>Server</th>
|
||||
<th>Paket</th>
|
||||
<th>Dibuat Oleh</th>
|
||||
<th>Status</th>
|
||||
<th>Catatan</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$aserver = mysqli_query($con,"SELECT * FROM v_order_list WHERE $SqlSvData status = 'order'");
|
||||
$no = 1;
|
||||
$aserver = mysqli_query($con,"SELECT * FROM v_order_list WHERE $SqlSvData status = 'order' ORDER BY time_start ASC, status_proses ASC");
|
||||
while ($server = mysqli_fetch_assoc($aserver))
|
||||
{
|
||||
|
||||
if ($server['status_proses'] == 'handling') {
|
||||
$borderColor = '#dc3545'; // Bootstrap danger
|
||||
$color = 'danger';
|
||||
} elseif ($server['status_proses'] == 'request') {
|
||||
$borderColor = '#ffc107'; // Bootstrap warning
|
||||
$color = 'warning';
|
||||
} elseif ($server['status_proses'] == 'ready') {
|
||||
$borderColor = '#198754'; // Bootstrap success
|
||||
$color = 'success';
|
||||
} else {
|
||||
$borderColor = '#0dcaf0'; // Bootstrap info
|
||||
$color = 'info';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td style="max-width: 100px;"><?php echo $server['time_start']; ?></td>
|
||||
<td style="max-width: 20px; border-left: 8px solid <?php echo $borderColor; ?>;"><?php echo $no; ?></td>
|
||||
<td class="align-middle" style="max-width: 100px;">
|
||||
<?php echo $server['time_start']; ?>
|
||||
</td>
|
||||
<td><?php echo $server['nama']; ?></td>
|
||||
<td style="max-width: 200px;"><?php echo $server['alamat']; ?></td>
|
||||
<td><?php echo $server['nama_desa']; ?></td>
|
||||
<td><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: 200px;"><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><?php echo $server['nomor_whatsapp']; ?> <a href="https://wa.me/<?php echo $server['nomor_whatsapp']; ?>" target="_blank" style="border-radius: 20px; " class="btn btn-sm btn-success">Chat</a></td>
|
||||
<td><?php echo $server['nama_server']; ?></td>
|
||||
<td><?php echo $server['nama_paket']; ?></td>
|
||||
<td><?php echo $server['create_with']; ?></td>
|
||||
<td>
|
||||
<span class="badge bg-<?php echo $color; ?> p-2">
|
||||
<?php echo ucfirst($server['status_proses']); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td style="max-width: 200px;"><?php echo $server['catatan']; ?></td>
|
||||
<td>
|
||||
<form method="post">
|
||||
<?php if(in_array("Survey", $json_array[18]['sub_menu'])){ ?>
|
||||
@@ -62,6 +90,12 @@
|
||||
<input type="submit" name="hapus<?php echo $server['id'];?>" value="Hapus" class="btn btn-danger btn-sm ml-1" />
|
||||
<?php } ?>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-warning btn-sm m-1 btnUpdateStatus"
|
||||
data-id="<?php echo $server['id']; ?>"
|
||||
data-status="<?php echo $server['status_proses']; ?>">
|
||||
Update Status
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@@ -70,6 +104,7 @@
|
||||
$iddata = $server['id'];
|
||||
deleteAlert("order_list",$iddata );
|
||||
}
|
||||
$no++;
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -77,6 +112,89 @@
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
|
||||
<!-- Modal Update Status -->
|
||||
|
||||
<div class="modal fade" id="modalUpdateStatus" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
|
||||
|
||||
<form method="post">
|
||||
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Update Status Proses</h5>
|
||||
|
||||
<button type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden"
|
||||
name="id_order"
|
||||
id="id_order">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Status Proses</label>
|
||||
|
||||
<select name="status_proses"
|
||||
id="status_proses"
|
||||
class="form-control"
|
||||
required>
|
||||
|
||||
<option value="">-- Pilih Status --</option>
|
||||
|
||||
<option value="ready">
|
||||
Siap Pasang
|
||||
</option>
|
||||
|
||||
<option value="handling">
|
||||
Perlu Penanganan
|
||||
</option>
|
||||
|
||||
<option value="pending">
|
||||
Pending
|
||||
</option>
|
||||
|
||||
<option value="request">
|
||||
Request Pelanggan
|
||||
</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-secondary"
|
||||
data-dismiss="modal">
|
||||
Batal
|
||||
</button>
|
||||
|
||||
<button type="submit"
|
||||
name="update_status_proses"
|
||||
class="btn btn-primary">
|
||||
Simpan Status
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
@@ -84,4 +202,61 @@
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
<!-- /.content -->
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.btnUpdateStatus', function () {
|
||||
|
||||
var id = $(this).data('id');
|
||||
var status = $(this).data('status');
|
||||
|
||||
$('#id_order').val(id);
|
||||
$('#status_proses').val(status);
|
||||
|
||||
$('#modalUpdateStatus').modal('show');
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($_POST['update_status_proses'])) {
|
||||
|
||||
$id_order = mysqli_real_escape_string(
|
||||
$con,
|
||||
$_POST['id_order']
|
||||
);
|
||||
|
||||
$status_proses = mysqli_real_escape_string(
|
||||
$con,
|
||||
$_POST['status_proses']
|
||||
);
|
||||
|
||||
$allowed_status = [
|
||||
'ready',
|
||||
'handling',
|
||||
'pending',
|
||||
'request'
|
||||
];
|
||||
|
||||
if (in_array($status_proses, $allowed_status)) {
|
||||
|
||||
mysqli_query(
|
||||
$con,
|
||||
"UPDATE order_list
|
||||
SET status_proses = '$status_proses'
|
||||
WHERE id = '$id_order'"
|
||||
);
|
||||
|
||||
echo "
|
||||
<script>
|
||||
window.location.href = window.location.href;
|
||||
</script>
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user