View difference between Paste ID: Td8DkGmK and rdepUExH
SHOW: | | - or go back to the newest paste.
1-
<title>Query 4, menghitung rata-rata</title>
1+
<script>$(document).ready(function() {
2-
<h2>Query 4 Menghitung Rata-rata nilai dari Query Tabel Users</h2>
2+
3-
<style type="text/css">
3+
$('#datepicker').datepicker({ dateFormat: "yy-mm-dd" });
4-
table {
4+
5-
  font: 12px/24px Verdana, Arial, Helvetica, sans-serif;
5+
$('#submit').click(function(event) {
6-
  border-collapse: collapse;
6+
	$('#result').html('Proses Pengambilan Data . . .');
7-
  width: 500px;
7+
	var FormData = $('#FormTiket').serialize();
8-
  margin:0 auto;
8+
	event.preventDefault();
9-
}
9+
	var myData;
10-
th {
10+
	$.ajax({
11-
  border: 1px solid #CCC;
11+
		type : "GET",
12-
  padding: 0 0.5em;
12+
		url:'http://biayaumroh.info/nusa.php',
13-
  text-align: center;
13+
		data: FormData,
14-
  background-color:#00FF66
14+
		cache: false,
15-
}
15+
	}).done(function(data){
16-
td {
16+
		if(data==''){
17-
  border: 1px solid #CCC;
17+
		$('#result').empty();
18-
  padding: 0 0.5em;
18+
		$('#result').html('Maaf, data tidak ada untuk rute ini.');
19-
  background-color:#DFFDD5;
19+
		}else{
20-
}
20+
			myData=data;
21-
h1 {
21+
22-
  color:#003300;
22+
		}
23-
  font:22px "Trebuchet MS";
23+
24-
  text-align:center;
24+
	});
25-
}
25+
26-
</style>
26+
	$.ajax({
27-
<table border="1" width="500px">
27+
		type : "POST",
28-
<tr>
28+
		url:'demo.php',
29-
<th>No</th>
29+
		data: {data:myData},
30-
<th>Nama Anak</th>
30+
		
31-
<th>Rata-rata Skor</th>
31+
	}).done(function(data){
32-
<th>Rata-rata Waktu</th>
32+
		$("#msg").html(data.msg);
33-
<th>Petunjuk</th>
33+
	});
34-
</th>
34+
});
35
</script>
36-
<!-- example 1 :menampilkan data di tabel-->
36+
<div id='msg'></div>