This repository has been archived by the owner on Feb 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cekongkir.php
122 lines (116 loc) · 5.64 KB
/
cekongkir.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
<?php
include 'header.php';
$_SESSION['page'] = 'cekongkir';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cek Ongkir</title>
</head>
<style>
.header-area {
background-image: url("assets/cekongkir.jpg");
}
</style>
<script>
function cekongkir() {
$.confirm({
title: 'Cek Ongkir <i class="fas fa-shipping-fast"></i>',
type: 'orange',
typeAnimated: true,
theme: 'modern',
columnClass: "col-md-5",
buttons: {
confirm: {
text: 'Cek Ongkir',
btnClass: 'btn-green',
action: function() {
var asal = this.$content.find('#asal').val();
var tujuan = this.$content.find('#tujuan').val();
var kategori = this.$content.find('#kategori').val();
var layanan = this.$content.find('#layanan').val();
if (asal && tujuan && kategori && layanan) {
$.ajax({
url: "phps/cekongkir.php",
method: "POST",
data: {
asal: asal,
tujuan: tujuan,
kategori: kategori,
layanan: layanan
},
success: function(data) {
$.alert("<center>Biaya ongkos kirim untuk kota asal <b>" + asal + "</b> dan kota tujuan <b>" + tujuan + "</b> dengan kategori berat barang <b>" + kategori + " kg</b> untuk jenis layanan <b>" + layanan + "</b> adalah sebesar<br><span style='font-weight: bold; font-size: 24pt;'>Rp" + data + "</span></center>");
},
error: function(data) {
alert('An error occurred.');
},
});
} else {
$.alert('<b style="color: red;">Silahkan mengisi semua kolom yang tersedia!</b>');
return false;
}
}
},
cancel: {
text: 'Cancel',
btnClass: 'btn-red',
action: function() {}
}
},
content: '' +
'<form id="myForm" enctype="multipart/form-data">' +
'<div class="form-group">' +
'<label for="asal" style="font-size: 12pt;"><b>Kota Asal <i class="fas fa-city"></i></b></label>' +
'</center><select class="form-control" id="asal" style="height:40px; font-size: 12pt;">' +
'<option value="">Pilih kota asal</option>' +
'<option value="Surabaya">Surabaya</option>' +
'<option value="Jakarta">Jakarta</option>' +
'<option value="Bandung">Bandung</option>' +
'<option value="Jogjakarta">Jogjakarta</option>' +
'<option value="Semarang">Semarang</option>' +
'</select>' +
'</div><br>' +
'<div class="form-group">' +
'<label for="tujuan" style="font-size: 12pt;"><b>Kota Tujuan <i class="fas fa-plane-departure"></i></b></label>' +
'</center><select class="form-control" id="tujuan" style="height:40px; font-size: 12pt;">' +
'<option value="">Pilih kota tujuan</option>' +
'<option value="Surabaya">Surabaya</option>' +
'<option value="Jakarta">Jakarta</option>' +
'<option value="Bandung">Bandung</option>' +
'<option value="Jogjakarta">Jogjakarta</option>' +
'<option value="Semarang">Semarang</option>' +
'</select>' +
'</div><br>' +
'<div class="form-group">' +
'<label for="kategori" style="font-size: 12pt;"><b>Kategori Berat Barang (kg) <i class="fas fa-weight"></i></b></label>' +
'</center><select class="form-control" id="kategori" style="height:40px; font-size: 12pt;">' +
'<option value="">Pilih kategori berat barang</option>' +
'<option value="1-5">1-5 kg</option>' +
'<option value="6-10">6-10 kg</option>' +
'<option value="11-15">11-15 kg</option>' +
'<option value="16-20">16-20 kg</option>' +
'</select>' +
'</div><br>' +
'<div class="form-group">' +
'<label for="layanan" style="font-size: 12pt;"><b>Jenis Layanan <i class="fas fa-truck-loading"></i></b></label>' +
'</center><select class="form-control" id="layanan" style="height:40px; font-size: 12pt;">' +
'<option value="">Pilih jenis layanan</option>' +
'<option value="ANDRE EKONOMIS">ANDRE EKONOMIS 💲</option>' +
'<option value="ANDRE REGULAR">ANDRE REGULAR 🚚</option>' +
'<option value="ANDRE HALILINTAR">ANDRE HALILINTAR ⚡</option>' +
'</select>' +
'</div><br>' +
'</form>'
});
}
</script>
<div class="banner" style="background-image: url('assets/cekongkir.png');">
<div class="container">
<h1>CEK ONGKIR</h1>
<p>Your package, our passion!</p>
<button class="button button-primary" style="border: 0" onclick="cekongkir()">Click Here</button>
</div>
</div>
</header>
<?php include 'footer.php' ?>