// range no. data
                $qy = 'select a.* 
						from v_pendataan a
						left join penetapan_pr_content b on b.pendataan_id=a.pendataan_id
						where b.pendataan_id is null and a.jenis_pungutan=\'OFFICE\' and a.pendataan_no between ' . quote_smart($_REQUEST['no_data_awal']) . ' and ' . quote_smart($_REQUEST['no_data_akhir']) . ' order by a.pendataan_no ';
                $result = gcms_query($qy);
                while ($rs = gcms_fetch_object($result)) {
                    if ($_REQUEST['cnomor'] == '') {
                        // tdk duplikasi
                        //echo 'Tdk Duplikasi, Range'."\n";
                        list($day, $month, $year) = explode('/', $_REQUEST['tgl_penetapan']);
                        $ID_HEADER = $fbird->setGenerator('GEN_PENETAPAN_PR');
                        $no_kohir = getNoKohir();
                        $exception = array();
                        $other_request = array('penetapan_pr_id' => $ID_HEADER, 'no_penetapan' => $no_kohir, 'thn_penetapan' => $year, 'nominal_penetapan' => $rs->nominal);
                        updateNoKohir($_REQUEST['tgl_penetapan']);
                        $a = $fbird->FBInsert('penetapan_pr', $other_request, $exception);
                        unset($exception);
                        unset($other_request);
                    }
                    $exception = array('penetapan_pr_content_id');
                    $other_request = array('penetapan_pr_id' => $ID_HEADER, 'pendataan_id' => $rs->pendataan_id, 'nominal' => $rs->nominal, 'jenis_pendataan' => $rs->jenis_pendataan, 'jenis_pungutan' => $rs->jenis_pungutan);
                    $b = $fbird->FBInsert('penetapan_pr_content', $other_request, $exception);
                    if (!$b) {
                        $cdetail = 0;
                    }
                }
            }
            if ($a && ($_REQUEST['cinput'] != '' && $cdetail)) {
                ibase_commit();
            } elseif ($a) {
                // range no. data
                $qy = 'select a.* 
						from v_penerimaan_pendataan a
						left join penerimaan_pr_content b on b.pendataan_id=a.pendataan_id
						where b.pendataan_id is null and a.pendataan_no between ' . quote_smart($_REQUEST['no_data_awal']) . ' and ' . quote_smart($_REQUEST['no_data_akhir']) . ' order by a.pendataan_no ';
                $result = gcms_query($qy);
                while ($rs = gcms_fetch_object($result)) {
                    if ($_REQUEST['cnomor'] == '') {
                        // tdk duplikasi
                        //echo 'Tdk Duplikasi, Range'."\n";
                        list($day, $month, $year) = explode('/', $_REQUEST['tgl_penerimaan']);
                        $ID_HEADER = $fbird->setGenerator('GEN_PENERIMAAN_PR');
                        $no_kohir = getNoKohir();
                        $exception = array();
                        $other_request = array('penerimaan_pr_id' => $ID_HEADER, 'no_penerimaan' => $no_kohir, 'thn_penerimaan' => $year, 'nominal_penerimaan' => $_REQUEST['nominal_pajak']);
                        updateNoKohir($_REQUEST['tgl_penerimaan']);
                        $a = $fbird->FBInsert('penerimaan_pr', $other_request, $exception);
                        unset($exception);
                        unset($other_request);
                    }
                    $exception = array('penerimaan_pr_content_id');
                    $other_request = array('penerimaan_pr_id' => $ID_HEADER, 'pendataan_id' => $rs->pendataan_id, 'nominal' => $rs->nominal, 'jenis_pendataan' => $rs->jenis_pendataan, 'jenis_pungutan' => $rs->jenis_pungutan);
                    $b = $fbird->FBInsert('penerimaan_pr_content', $other_request, $exception);
                    if (!$b) {
                        $cdetail = 0;
                    }
                }
            }
            if ($a && ($_REQUEST['cinput'] != '' && $cdetail)) {
                ibase_commit();
            } elseif ($a) {