Added Unapprove Page, Detail Modal and function to delete and approve Mechanic Location (bengkel)
@sogata
· 2019-06-21 00:31
· utopian-io
Repository
https://github.com/sogatanco/nebeng
About NEBENG
NEBENG (Nemu-Bengkel) is an application to find the nearest car workshop and motorcycle workshop. When your vehicle is damaged in transit, you don't know where it is closest to repairing it. Nebeng is the solution.
What feature(s) did you add?
Unapprove Page is a page that displays the list of locations that was just entered by the user. this is where the admin reviews whether this location is acceptable or not
Detail Modal
is a pop-up to display details of the location. here all data related to location are displayed such as rating, description, cellphone number etc.
Delete Function
is a function to delete location. this function call by a button on Detail modal
Approve function
is a function to approve location after reviewed by admin. if the location is not fake, admin will press approve button on modal detail to call this function.
How did you implement it/them?
all processes in the features we have added are made using the PHP (Codeigniter), Bootstrap and jQuery programming languages. data and action requested from the Rest API that we made yesterday. Here's a little code snippet:
$('#content').on( "click",".card-view", function() {
initialize(new google.maps.LatLng($(this).data('lat'), $(this).data('long')));
$('#judul').html(ca($(this).data('judul')));
$('#tombol').html(`
`)
$('#attribute').html(``+$(this).data('rating')+` `+$(this).data('ulasan')+` ulasan | `+$(this).data('kategori'));
$("#deskripsi").html($(this).data('desk')+`.`);
$("#layanan").html(`Bengkel ini ditambahkan oleh `+$(this).data('pemilik')+ ` sejak `+$(this).data('tanggal')+ `. Adapun layanan yang bisa didapatkan di sini antara lain :` +$(this).data('lay')+` dengan waktu pengoprasian mulai dari ` +$(this).data('waktu')+` WIB. Untuk informasi lebih lanjut silakan menghubungi langsung `+$(this).data('tlp')+`.`);
$.ajax({
type:"get",
url:"../../api/general/ulasan?token=1234567&idbengkel="+$(this).data('id'),
success:function(respon){
$('#komentars').html('');
$.each(respon.data, function(i,d){
bintang=parseFloat(d.ul_rating)
bintang=bintang.toFixed(1)
$('#komentars').append(`