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

IF($lisensi==$lis){
    $query = mysqli_query($con,"Select gtm.id_grup as ID, grup.nama as nama, count(gtm.id_member) as jml from grup, gtm where gtm.id_grup=grup.id group by gtm.id_grup");
        
        if ($query) {
            $posts = array();
            if(mysqli_num_rows($query)) {
                while ($post = mysqli_fetch_assoc($query)) {
                    $posts[] = $post;
                }
            }
            
            echo json_encode(array('grup'=>$posts));
        }
}        
?>