if ($DEBUGMODE == 1) {
     $firephp->info('READ', 'action');
 }
 /*query to count rows*/
 if ($postConfig['q'] != q) {
     //$sql='select count(*) as numRows from '.$crudTableName.' where '.$crudFK.' = '.$postConfig[$crudFK];
     $sql = 'select count(*) as numRows from anggaran_tahun ';
 } else {
     //$sql='select count('.$postConfig['id'].') as numRows from '.$crudTableName;
     $sql = 'select count(*) as numRows from anggaran_tahun ';
 }
 if ($DEBUGMODE == 1) {
     $firephp->info($sql, 'query');
 }
 $result = gcms_query($sql);
 $row = gcms_fetch_assoc($result);
 $count = $row["NUMROWS"];
 if ($DEBUGMODE == 1) {
     $firephp->info($count, 'rows');
 }
 $intLimit = $postConfig['limit'];
 /*set the page count*/
 if ($count > 0 && $intLimit > 0) {
     $total_pages = ceil($count / $intLimit);
 } else {
     $total_pages = 1;
 }
 if ($DEBUGMODE == 1) {
     $firephp->info($total_pages, 'total_pages');
 }
 $intPage = $postConfig['page'];
 if ($DEBUGMODE == 1) {
     $firephp->info('READ', 'action');
 }
 /*query to count rows*/
 if ($postConfig['q'] != q) {
     //$sql='select count(*) as numRows from '.$crudTableName.' where '.$crudFK.' = '.$postConfig[$crudFK];
     $sql = 'select count(*) as numRows from ' . $crudTableName . ' ';
 } else {
     //$sql='select count('.$postConfig['id'].') as numRows from '.$crudTableName;
     $sql = 'select count(*) as numRows from ' . $crudTableName . ' ';
 }
 if ($DEBUGMODE == 1) {
     $firephp->info($sql, 'query');
 }
 $result = gcms_query($sql);
 while ($row = gcms_fetch_assoc($result)) {
     $count += $row["NUMROWS"];
 }
 if ($DEBUGMODE == 1) {
     $firephp->info($count, 'rows');
 }
 $intLimit = $postConfig['limit'];
 /*set the page count*/
 if ($count > 0 && $intLimit > 0) {
     $total_pages = ceil($count / $intLimit);
 } else {
     $total_pages = 1;
 }
 if ($DEBUGMODE == 1) {
     $firephp->info($total_pages, 'total_pages');
 }