<?php
require_once 'config.php';
require_once 'fungsi.php';
$lis = mysqli_real_escape_string($con,$_GET['ver']);
$grup = mysqli_real_escape_string($con,$_GET['grup']);

IF($lisensi==$lis){
    $query = mysqli_query($con,"Select gtm.id_member as ID, prospek.nama as nama, prospek.email as email, prospek.hp as hp, gtm.tgl_gabung as tgl_gabung, gtm.kirim as kirim, gtm.baca as baca, gtm.gagal as gagal, gtm.id_grup as grup from gtm, prospek where gtm.id_member=prospek.ID and gtm.id_grup='$grup'");
        
        if ($query) {
            $posts = array();
            if(mysqli_num_rows($query)) {
                while ($post = mysqli_fetch_assoc($query)) {
                    $posts[] = $post;
                }
            }
            
            echo json_encode(array('prospek'=>$posts));
        }
}        
?>