<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Report_rekap_upaya_hukum_banding extends CI_Model{
	
	function get_info_pn(){
		try {
			$this->db->select('*');
			$this->db->where('id >=', 61); 
			return $this->db->get('sys_config');
		} catch (Exception $e) {
			log_message('error', $e);
		}
	}
	function getJenisPerkara($idalurperkara){
		if(empty($idalurperkara)) return '';
		try {
			$this->db->where('id',$idalurperkara);
			return $this->db->get('alur_perkara')->row()->nama;
		} catch (Exception $e) {
			log_message('error', $e);
		}
	}

	function get_rekap($idalurperkara,$year){
		try {
			return $this->db->query("SELECT 
		1 AS nomor
		,'Permohonan Banding' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-01') AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-02') AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-03') AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-04') AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-05') AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-06') AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-07') AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-08') AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-09') AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-10') AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-11') AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) = CONCAT('".$year."','-12') AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND YEAR(permohonan_banding) = ".$year.") AS total

		UNION 
		SELECT 
		2 AS nomor
		,'Pengiriman Berkas' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-01') AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-02') AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-03') AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-04') AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-05') AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-06') AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-07') AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-08') AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-09') AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-10') AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-11') AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pengiriman_berkas_banding,7) = CONCAT('".$year."','-12') AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND YEAR(pengiriman_berkas_banding) = ".$year.") AS total

		UNION
		SELECT 
		3 AS nomor
		,'Putusan PT' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-01') AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-02') AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-03') AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-04') AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-05') AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-06') AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-07') AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-08') AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-09') AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-10') AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-11') AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(putusan_banding,7) = CONCAT('".$year."','-12') AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND YEAR(putusan_banding) = ".$year.") AS total

		UNION
		SELECT 
		4 AS nomor
		,'Belum Putus PT' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-01') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-01') ) AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-02') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-02') ) AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-03') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-03') ) AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-04') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-04') ) AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-05') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-05') ) AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-06') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-06') ) AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-07') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-07') ) AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-08') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-08') ) AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-09') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-09') ) AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-10') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-10') ) AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-11') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-11') ) AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-12') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-12') ) AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(permohonan_banding,7) <= CONCAT('".$year."','-12') AND (putusan_banding IS NULL OR LEFT(putusan_banding,7) > CONCAT('".$year."','-12') ) ) AS total

		UNION 
		SELECT 
		5 AS nomor
		,'Penerimaan PN' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-01') AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-02') AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-03') AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-04') AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-05') AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-06') AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-07') AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-08') AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-09') AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-10') AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-11') AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(penerimaan_kembali_berkas_banding,7) = CONCAT('".$year."','-12') AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND YEAR(penerimaan_kembali_berkas_banding) = ".$year.") AS total

		UNION 
		SELECT 
		6 AS nomor
		,'Pemberitahuan Pembanding/Terbanding' AS nama
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-01') AND CONCAT('".$year."','-01') <= LEFT(CURRENT_DATE(),7) ) AS bl01
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-02') AND CONCAT('".$year."','-02') <= LEFT(CURRENT_DATE(),7) ) AS bl02
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-03') AND CONCAT('".$year."','-03') <= LEFT(CURRENT_DATE(),7) ) AS bl03
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-04') AND CONCAT('".$year."','-04') <= LEFT(CURRENT_DATE(),7) ) AS bl04
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-05') AND CONCAT('".$year."','-05') <= LEFT(CURRENT_DATE(),7) ) AS bl05
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-06') AND CONCAT('".$year."','-06') <= LEFT(CURRENT_DATE(),7) ) AS bl06
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-07') AND CONCAT('".$year."','-07') <= LEFT(CURRENT_DATE(),7) ) AS bl07
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-08') AND CONCAT('".$year."','-08') <= LEFT(CURRENT_DATE(),7) ) AS bl08
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-09') AND CONCAT('".$year."','-09') <= LEFT(CURRENT_DATE(),7) ) AS bl09
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-10') AND CONCAT('".$year."','-10') <= LEFT(CURRENT_DATE(),7) ) AS bl10
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-11') AND CONCAT('".$year."','-11') <= LEFT(CURRENT_DATE(),7) ) AS bl11
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND LEFT(pemberitahuan_putusan_banding,7) = CONCAT('".$year."','-12') AND CONCAT('".$year."','-12') <= LEFT(CURRENT_DATE(),7) ) AS bl12
		,(SELECT COUNT(*) FROM perkara_banding WHERE alur_perkara_id IN(".$idalurperkara.") AND YEAR(pemberitahuan_putusan_banding) = ".$year.") AS total
		");
		} catch (Exception $e) {
			
		}
	}
}