Esempio n. 1
0
	function list_kamar($hal = 0) {
		$paging = new MyPagina;
	    
        $paging->sql = "select p.nama as bangsal,
                               k.id as kamar_id,
                               k.nama as nama_kamar, 
                               rk.nomor as no_kamar,
                               rk.status as status 
                               from kamar k, ref_kamar rk,
                               pelayanan p 
                               where k.id = rk.kamar_id and k.pelayanan_id = p.id
                               and p.jenis = 'RAWAT INAP'
                               order by p.nama, k.kelas, k.nama";
            
		
		
		$paging->rows_on_page = 15;
		$paging->hal = $hal;
		$_SESSION[modul_setting][no_kamar][hal] = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 350;
		$table->addTh(
			"No", 
			"Nama Bangsal", 
			"Nama Kamar", 
			"No Bed",
            "Status",
			"Hapus"
		);
		$table->addExtraTh("style=\"width:50px;\"","style=\"width:200px;\"","","","","","","style=\"width:70px;\"");
		$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][bangsal], 
				$data[$i][nama_kamar],
				$data[$i][no_kamar],
                $data[$i][status], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kamar('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>"
			);
			$table->addOnclickTd(
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')"
			);
		}
		$buka = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_kamar", "innerHTML", $buka);
		return $objResponse;
	}
Esempio n. 2
0
	function list_data_radio($hal = 0) {
		$_SESSION[setting_radiologi_spesimen][hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 15;
		$paging->sql = "
			SELECT 
				rp.id as id,
				rp.nama as nama,
				rp.biaya_bhp as biaya_bhp,
				rpd.biaya_jasa as biaya_jasa,
				rpd.kelas as kelas
			FROM 
				radio_pemeriksaan rp
				JOIN radio_pemeriksaan_detil rpd ON (rpd.tingkat = rp.tingkat)			
			ORDER BY 
				rp.nama
			";
		
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 350;
		$table->addTh(
			"No", 
			"Nama", 
			"Biaya BHP", 
			"Biaya Jasa",
			"Kelas",
			"Hapus"
		);
		//$table->addExtraTh("style=\"width:50px;\"","style=\"width:200px;\"","","","");
		//$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][nama],
				$data[$i][biaya_bhp], 
				$data[$i][biaya_jasa],
				$data[$i][kelas], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kamar('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>"
			);
			$table->addOnclickTd(
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')", 
				"xajax_get_info('".$data[$i][id]."')"
			);
		}
		$buka = $table->build();
		$objResponse->addAssign("list_data_radio", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 3
0
	function list_data($hal = 0) {
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "SELECT id, nama, alamat FROM ref_perujuk ORDER BY nama";
		$paging->get_page_result();
		$paging->hal = $hal;
		$_SESSION[hal] = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 420;
		$table->addTh("No", "Nama", "Alamat", "Hapus");
		$table->addExtraTh(" style=\"width: 50px;\"", " style=\"width: 200px;\"", "", " style=\"width: 70px;\" ");
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][nama], 
				$data[$i][alamat], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_perujuk('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$table->addExtraTd(
				" onclick=\"xajax_get_perujuk('".$data[$i][id]."')\" ", 
				" onclick=\"xajax_get_perujuk('".$data[$i][id]."')\" ", 
				" onclick=\"xajax_get_perujuk('".$data[$i][id]."')\" ");
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 4
0
	function list_data($hal = 0) {
		$_SESSION[hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "SELECT 
				i.id as icid, 
				i.kode as kode, 
				i.nama as nama, 
				id.id as idid,
				id.*
		FROM 
			icopim i 
			LEFT JOIN icopim_detil id ON (id.tingkat = i.tingkat) 
		GROUP BY i.id, id.kelas
		ORDER BY i.nama, id.kelas
		";
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 400;
		$tabel->addTh(
			"No", 
			"Kode", 
			"Tindakan", 
			"Tingkat", 
			"Kelas", 
			"Biaya",		
			"Hapus"
		);

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addRow(
				($no+$i), 
				$data[$i][kode], 
				$data[$i][nama], 
				$data[$i][tingkat], 
				$data[$i][kelas], 
				$data[$i][biaya],			 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_tindakan('".$data[$i][icid]."', '".$data[$i][idid]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')", 
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')", 
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')", 
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')", 
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')", 
				"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')"				
			);
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 5
0
	function list_data($hal = 0) {
		$_SESSION[hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;

		$paging->sql = "
			SELECT 
				d.id as id, 
				d.nama as nama, 
				spc.id as spc_id, 
				spc.nama as spc_nama, 
				sub.id as sub_id, 
				sub.nama as sub_nama, 
				d.telp as telp, 
				d.aktif as aktif,
				CASE 
					WHEN (d.aktif = '1') THEN 'Ya'
					ELSE 'Tidak'
				END AS aktif_nama
				FROM 
					dokter d 
					JOIN subspesialisasi sub ON (sub.id = d.subspesialisasi_id)
					JOIN spesialisasi spc ON (spc.id = sub.spesialisasi_id)
				ORDER BY 
					spc.nama, sub.nama, d.nama
			";
		$paging->hal = $hal;
		$paging->get_page_result();
		$_SESSION[modul_setting][dokter][hal] = $hal;
		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 380;
		$tabel->addTh("No", "Nama", "Spesialisasi/<br />Sub Spesialisasi", "Telp", "Aktif", "Hapus");
		$tabel->addExtraTh(" style=\"width:50px;\"", "style=\"width:200px;\"", "", "", "", " style=\"width:70px;\" ");

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addRow(
				($no+$i), 
				$data[$i][nama], 
				$data[$i][spc_nama] . "<br />" . $data[$i][sub_nama], 
				$data[$i][telp], $data[$i][aktif_nama], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_dokter('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_dokter('".$data[$i][id]."')", 
				"xajax_get_dokter('".$data[$i][id]."')", 
				"xajax_get_dokter('".$data[$i][id]."')", 
				"xajax_get_dokter('".$data[$i][id]."')"
			);
		}
		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 6
0
	function list_data($hal = 0, $prop_id = "", $kab_id = "") {
		$_SESSION[setting_kecamatan][hal] = $hal;
		//$all_id = @explode("|", $prop_kab_id);
		if($prop_id) $s .= " AND p.id = '".$prop_id."'";
		if($kab_id) $s .= " AND k.id = '".$kab_id."'";

		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->setOnclickValue($prop_id, $kab_id);
		//$paging->onclick2_value = "'" . $prop_kab_id . "'";
		$paging->sql = "
			SELECT 
				kec.id AS id, 
				p.id AS prop_id,
				p.nama AS prop, 
				k.id AS kab_id,
				k.nama AS kab,
				kec.nama AS nama,
				COUNT(d.id) as jml_desa
			FROM 
				ref_kecamatan kec 
				JOIN ref_kabupaten k ON (k.id = kec.kabupaten_id)
				JOIN ref_propinsi p ON (p.id = k.propinsi_id) 
				LEFT JOIN ref_desa d ON (d.kecamatan_id = kec.id)
			WHERE
				1=1
				$s
			GROUP BY kec.id
			ORDER BY p.nama, k.nama, kec.nama
			
		";
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 370;
		$tabel->addTh("No", "Propinsi", "Kabupaten", "Kecamatan", "Jml<br />Kelurahan", "Hapus");
		$tabel->addExtraTh(" style=\"width: 50px;\"", " style=\"width: 200px;\"", "", "", "style=\"width: 100px;\"", " style=\"width: 70px;\" ");

		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][prop_id] != $data[$i-1][prop_id]) $prop = $data[$i][prop];
			else $prop = "";
			if($data[$i][kab_id] != $data[$i-1][kab_id]) $kab = $data[$i][kab];
			else $kab = "";
			$tabel->addRow(($no+$i), $prop, $kab, $data[$i][nama], $data[$i][jml_desa], "<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kecamatan('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd("xajax_get_kecamatan('".$data[$i][id]."')","xajax_get_kecamatan('".$data[$i][id]."')", "xajax_get_kecamatan('".$data[$i][id]."')", "xajax_get_kecamatan('".$data[$i][id]."')");
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 7
0
	function list_data($hal = 0) {
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "SELECT 
			p.id as id, 
			p.nama as nama,
			p.username as username,
			pg.nama as `group`,
			pel.nama as pelayanan
		FROM 
			pengguna p
			JOIN pengguna_group pg ON (pg.id = p.pengguna_group_id)
			LEFT JOIN pelayanan pel ON (pel.id = p.pelayanan_id)
		WHERE pg.id <> 1
		ORDER BY 
			pg.nama,
			p.nama";

		$paging->get_page_result();
		$paging->hal = $hal;
		$_SESSION[hal] = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 300;
		$table->addTh("No", "Nama", "Username", "Group", "Bangsal/<br />Klinik", "Hapus");
		$table->addExtraTh(" style=\"width: 50px;\"", "", "", "", "", " style=\"width: 70px;\" ");
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][nama], 
				$data[$i][username], 
				$data[$i][group], 
				$data[$i][pelayanan], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_pengguna('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");

			$table->addOnclickTd(
				"xajax_get_pengguna('".$data[$i][id]."')", 
				"xajax_get_pengguna('".$data[$i][id]."')", 
				"xajax_get_pengguna('".$data[$i][id]."')", 
				"xajax_get_pengguna('".$data[$i][id]."')", 
				"xajax_get_pengguna('".$data[$i][id]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 8
0
	function list_data($hal = 0) {
		$paging = new MyPagina;
		$paging->sql = "
			SELECT 
				pel.id as id, 
				pel.jenis as jenis,
				pel.nama as nama,
				spc.nama as spec,
				pel.hari_buka as hari_buka
			FROM 
				pelayanan pel
				JOIN spesialisasi spc ON (spc.id = pel.spesialisasi_id)
			WHERE
				pel.jenis IN ('RAWAT JALAN', 'RAWAT INAP')
			ORDER BY pel.jenis, spc.nama";
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();
		$_SESSION[hal] = $hal;
		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->addTh("No", "Jenis<br />Pelayanan", "Spesialisasi", "Nama Poliklinik/<br />Bangsal", "Hari Buka<br />Seminggu", "Hapus");
		$table->addExtraTh("style=\"width:50px;\"","","","","","style=\"width:70px;\"");
		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][jenis] == $data[$i-1][jenis])
				$jenis = "";
			else 
				$jenis = $data[$i][jenis];
			$table->addRow(
				($no+$i), 
				$jenis, 
				$data[$i][spec], 
				$data[$i][nama], 
				$data[$i][hari_buka], 
				"<input type=\"button\" value=\"[  x  ]\" name=\"hapus\" class=\"inputan\" onclick=\"xajax_hapus_pelayanan_confirm('".$data[$i][id]."', '".addslashes($data[$i][nama])."')\" />"
			);
			$table->addOnclickTd(
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 9
0
	function list_data($hal = 0) {
		$paging = new MyPagina;
		$paging->sql = "
			SELECT 
				pel.id as id, 
				pel.nama as nama,
				spc.nama as spec,
				pel.hari_buka as hari_buka,
                pel.tarif as tarif
			FROM 
				pelayanan pel
				JOIN spesialisasi spc ON (spc.id = pel.spesialisasi_id)
			WHERE
				pel.jenis ='RAWAT JALAN'
			ORDER BY spc.nama";
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();
		$_SESSION[hal] = $hal;
		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 390;
		$table->addTh("No", "Nama Poliklinik", "Spesialisasi", "Hari Buka<br />Seminggu", "Tarif","Hapus");
		$table->addExtraTh("style=\"width:50px;\"","","","","","style=\"width:70px;\"");
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][nama], 
				$data[$i][spec], 
				$data[$i][hari_buka],$data[$i][tarif], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_pelayanan('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>"
			);
			$table->addOnclickTd(
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')", 
				"xajax_get_pelayanan('".$data[$i][id]."')",
                "xajax_get_pelayanan('".$data[$i][id]."')"                
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 10
0
	function list_data($hal = 0) {
		$_SESSION[setting_bhp][hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "SELECT id,  nama, biaya, bhp_p, bhp_rs, bhp_rs_adm, bhp_rs_op FROM bhp ORDER BY nama";
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 430;
		$tabel->addTh("No", "BHP", "Biaya", "bhp p", "bhp rs", "bhp rs adm", "bhp rs op", "Hapus");
		//$tabel->addExtraTh("style=\"width: 50px;\"", "", " style=\"width: 70px;\"");

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addRow(
				($no+$i), 
				$data[$i][nama], 
				$data[$i][biaya], 
				$data[$i][bhp_p], 
				$data[$i][bhp_rs], 
				$data[$i][bhp_rs_adm], 
				$data[$i][bhp_rs_op], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_bhp('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')", 
				"xajax_get_bhp('".$data[$i][id]."')"
			);
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 11
0
	function list_data($hal = 0) {
		$_SESSION[setting_karcis][hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "SELECT * FROM karcis ORDER BY jenis, nama";
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 430;
		$tabel->addTh("No", "Nama", "Jenis", "Kelas", "Jasa", "Hapus");
		//$tabel->addExtraTh("style=\"width: 50px;\"", "", " style=\"width: 70px;\"");

		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][jenis] == "IGD") $jenis = "IRD";
			else $jenis = $data[$i][jenis];
			$tabel->addRow(
				($no+$i), 
				$data[$i][nama], 
				$jenis, 
				$data[$i][kelas], 
				$data[$i][biaya_jasa], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_karcis('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_karcis('".$data[$i][id]."')", 
				"xajax_get_karcis('".$data[$i][id]."')", 
				"xajax_get_karcis('".$data[$i][id]."')", 
				"xajax_get_karcis('".$data[$i][id]."')", 
				"xajax_get_karcis('".$data[$i][id]."')"			
			);
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 12
0
	function list_data($hal = 0) {
		$_SESSION[setting_imunisasi][hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "
		SELECT 
			id as id,
			nama as nama,
			sebab_sakit as sebab_sakit
		FROM
			imunisasi
		ORDER BY 
			nama
		";
		$paging->hal = $hal;
		$paging->get_page_result();		
		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 350;
		$tabel->addTh("No", "Nama", "Sebab Sakit", "Hapus");
		$tabel->addExtraTh(" style=\"width:50px;\"", "style=\"width:200px;\"", "", " style=\"width:70px;\"");

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addRow(($i+1), $data[$i][nama], $data[$i][sebab_sakit], "<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_imunisasi('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_imunisasi('".$data[$i][id]."')", 
				"xajax_get_imunisasi('".$data[$i][id]."')", 
				"xajax_get_imunisasi('".$data[$i][id]."')"
			);
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 13
0
	function list_data($hal = 0) {
		$_SESSION[setting_propinsi][hal] = $hal;
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 20;
		$paging->sql = "
			SELECT 
				p.id AS id, 
				p.nama AS nama, 
				COUNT(k.id) AS jml_kab
			FROM 
				ref_propinsi p 
				LEFT JOIN ref_kabupaten k ON (k.propinsi_id = p.id) 
			GROUP BY 
				p.id 
			ORDER BY 
				p.nama
		";
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$tabel = new Table;
		$tabel->tbody_height = 420;
		$tabel->addTh("No", "Propinsi", "Jml<br />Kabupaten", "Hapus");
		$tabel->addExtraTh(" style=\"width: 50px;\"", "", " style=\"width: 100px;\"", " style=\"width: 70px;\" ");

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addRow(($no+$i), $data[$i][nama], $data[$i][jml_kab], "<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_propinsi('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd("xajax_get_propinsi('".$data[$i][id]."')", "xajax_get_propinsi('".$data[$i][id]."')", "xajax_get_propinsi('".$data[$i][id]."')");
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 14
0
	function list_data($hal=0, $val="") {
		if($val[pasien_id]) {
			$s = "p.id = '".$val[pasien_id]."'";
		} elseif($val[nama]) {
			$s = "p.nama LIKE '%".$val[nama]."%'";
		} elseif ($val[telp]){
            $s = "p.telp LIKE '%".$val[telp]."%'";
		}
		
		$tgl_periksa_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
		$tgl_periksa_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
			
		$paging = new MyPagina;
        $kon = new Konek;
		$paging->setOnclickValue("xajax.getFormValues('form_kunjungan')");
		
		
		if ($val[pasien_id]=='' AND $val[nama]=='' AND $val[telp]=='')
		{
		//pemilihan untuk list
		if ($val[cara_masuk_p]=='RAWAT JALAN')
		{
			$sql = "
			SELECT
					k.id as id_kunjungan,
					kk.id as id_kunjungan_kamar,
                    kk.kunjungan_id as kunjungan_id,
					k.kunjungan_ke as kunjungan_ke,
					kk.no_antrian as no_antrian,
					CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
					p.id as pasien_id,
					p.nama as nama,
					pel.nama as pelayanan,
				CASE 
					WHEN jenis = 'PASIEN LUAR' THEN 'PASIEN LUAR'
					WHEN jenis = 'IGD' THEN 'IRD'
					ELSE CONCAT_WS(' - ', jenis, kmr.nama)
				END as asal,
					kmr.nama as kamar,
					kk.tgl_periksa as tgl_periksa,
					d.nama as pengirim,
					kk.kelanjutan as kelanjutan
				FROM
					kunjungan k
					JOIN pasien p ON (p.id = k.pasien_id)
					JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
					JOIN kamar kmr ON (kmr.id = kk.kamar_id)
					JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
					LEFT JOIN dokter d ON (d.id = kk.dokter_id)
				WHERE
					DATE(kk.tgl_periksa) BETWEEN '".$tgl_periksa_dari."' AND '".$tgl_periksa_sampai."'
					AND pel.jenis = 'RAWAT JALAN'
			 		
				ORDER BY
					kmr.nama, d.nama, kk.no_antrian
		";
		}
		elseif ($val[cara_masuk_p]=='RAWAT INAP')
		{
			$sql = "
			SELECT
					k.id as id_kunjungan,
					kk.id as id_kunjungan_kamar,
                    kk.kunjungan_id as kunjungan_id,
					k.kunjungan_ke as kunjungan_ke,
					kk.no_antrian as no_antrian,
					CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
					p.id as pasien_id,
					p.nama as nama,
					pel.nama as pelayanan,
				CASE 
					WHEN jenis = 'PASIEN LUAR' THEN 'PASIEN LUAR'
					WHEN jenis = 'IGD' THEN 'IRD'
					ELSE CONCAT_WS(' - ', jenis, kmr.nama)
				END as asal,
					kmr.nama as kamar,
					kk.tgl_periksa as tgl_periksa,
					d.nama as pengirim,
					kk.kelanjutan as kelanjutan
				FROM
					kunjungan k
					JOIN pasien p ON (p.id = k.pasien_id)
					JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
					JOIN kamar kmr ON (kmr.id = kk.kamar_id)
					JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
					LEFT JOIN dokter d ON (d.id = kk.dokter_id)
				WHERE
					DATE(kk.tgl_periksa) BETWEEN '".$tgl_periksa_dari."' AND '".$tgl_periksa_sampai."'
					AND pel.jenis = 'RAWAT INAP'
			 		
				ORDER BY
					kmr.nama, d.nama, kk.no_antrian
		";
		}
		elseif ($val[cara_masuk_p]=='PASIEN LUAR')
		{
			$sql = "
			SELECT 
                kk.kunjungan_id as kunjungan_id,
				rk.id as id_kunjungan_radio,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				CASE 
					WHEN cara_masuk = 'PASIEN LUAR' THEN 'PASIEN LUAR'
					WHEN cara_masuk = 'IGD' THEN 'IRD'
					ELSE CONCAT_WS(' - ', cara_masuk, kmr.nama)
				END as asal,
				rk.tgl_periksa as tgl_periksa,
				pengirim as pengirim
			FROM 
				radio_kunjungan rk
				JOIN pasien p ON (p.id = rk.pasien_id)
				LEFT JOIN kunjungan_kamar kk ON (kk.id = rk.kunjungan_kamar_id)
				LEFT JOIN kamar kmr ON (kmr.id = kk.kamar_id)
			WHERE
				DATE(rk.tgl_periksa) BETWEEN '".$tgl_periksa_dari."' AND '".$tgl_periksa_sampai."'
				AND rk.cara_masuk = 'PASIEN LUAR'
			ORDER BY 
				rk.id DESC
		";
		}
		elseif ($val[cara_masuk_p]=='IGD')
		{
			$sql = "
			SELECT
					k.id as id_kunjungan,
					kk.id as id_kunjungan_kamar,
                    kk.kunjungan_id as kunjungan_id,
					k.kunjungan_ke as kunjungan_ke,
					kk.no_antrian as no_antrian,
					CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
					p.id as pasien_id,
					p.nama as nama,
					pel.nama as pelayanan,
				CASE 
					WHEN jenis = 'PASIEN LUAR' THEN 'PASIEN LUAR'
					WHEN jenis = 'IGD' THEN 'IRD'
					ELSE CONCAT_WS(' - ', jenis, kmr.nama)
				END as asal,
					kmr.nama as kamar,
					kk.tgl_periksa as tgl_periksa,
					d.nama as pengirim,
					kk.kelanjutan as kelanjutan
				FROM
					kunjungan k
					JOIN pasien p ON (p.id = k.pasien_id)
					JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
					JOIN kamar kmr ON (kmr.id = kk.kamar_id)
					JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
					LEFT JOIN dokter d ON (d.id = kk.dokter_id)
				WHERE
					DATE(kk.tgl_periksa) BETWEEN '".$tgl_periksa_dari."' AND '".$tgl_periksa_sampai."'
					AND pel.jenis = 'IGD'
			 		
				ORDER BY
					kmr.nama, d.nama, kk.no_antrian
		";
		}
		}
		else
		{
			$sql = "
			SELECT
					k.id as id_kunjungan,
					kk.id as id_kunjungan_kamar,
                    kk.kunjungan_id as kunjungan_id,
					k.kunjungan_ke as kunjungan_ke,
					kk.no_antrian as no_antrian,
					CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
					p.id as pasien_id,
					p.nama as nama,
					pel.nama as pelayanan,
				CASE 
					WHEN jenis = 'PASIEN LUAR' THEN 'PASIEN LUAR'
					WHEN jenis = 'IGD' THEN 'IRD'
					ELSE CONCAT_WS(' - ', jenis, kmr.nama)
				END as asal,
					kmr.nama as kamar,
					kk.tgl_periksa as tgl_periksa,
					d.nama as pengirim,
					kk.kelanjutan as kelanjutan
				FROM
					kunjungan k
					JOIN pasien p ON (p.id = k.pasien_id)
					JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
					JOIN kamar kmr ON (kmr.id = kk.kamar_id)
					JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
					LEFT JOIN dokter d ON (d.id = kk.dokter_id)
				WHERE
					$s
				ORDER BY
					kmr.nama, d.nama, kk.no_antrian
		";
		}
		$paging->sql = $sql;
		$paging->rows_on_page = 10;
		$paging->hal = $hal;
		$paging->get_page_result();

		$_SESSION[radio_kunjungan][hal] = $hal;

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 310;
		$table->addTh(
			"No", 
			"No.<br />Kjg",
			"No. RM", 
			"Pasien", 
			"Tgl<br />Periksa",
			"Asal<br />Pasien",
			"Dokter<br />Pengirim", 
			"Status Bayar"
			/*,"Hapus"*/
		);
		//$table->addExtraTh("style=\"width:50px;\"","style=\"width:50px;\"","style=\"width:80px;\"","style=\"width:200px;\"","","","","","","","style=\"width:70px;\"");
		$table->addExtraTh("style=\"width:50px;\"","style=\"width:50px;\"","style=\"width:80px;\"","style=\"width:200px;\"","","","","");
		for($i=0;$i<sizeof($data);$i++) {
		  
                  //get data radio
            	$kon->sql = "
            		SELECT
            			kb.nama as nama,
            			kb.bayar_bhp+kb.bayar_jasa as bayar,
            			kb.mampu_bayar_bhp+kb.mampu_bayar_jasa as mampu_bayar,
            			kwd.kwitansi_id as kwitansi_id,
                        kw.status as status
            		FROM
            			kunjungan_bayar kb
            			JOIN radio_kunjungan lk ON (lk.id = kb.lab_kunjungan_id)
            			JOIN kunjungan_kamar kk ON (kk.id = lk.kunjungan_kamar_id)
            			LEFT JOIN kwitansi_detil kwd ON (kwd.kunjungan_bayar_id = kb.id)
                        LEFT JOIN kwitansi kw ON  (kw.id = kwd.kwitansi_id)
            		WHERE
            			kb.radio_specimen_id IS NOT NULL
            			AND kk.kunjungan_id = '".$data[$i][kunjungan_id]."'
            		GROUP BY
            			kb.id
            		ORDER BY kb.id
            	";
            	$kon->execute();
        		$data_r = $kon->getOne();
                if(!empty($data_r)){
                    if (!empty($data_r[status])){
                        $status_bayar = "<font color = blue><b>LUNAS</b></font>";
                    }    
                    else {
                        $status_bayar = "<font color = red><b>BELUM LUNAS</b></font>";                        
                    }        
                }else 
                {$status_bayar = "<font color = red><b>BELUM LUNAS</b></font>";}
          
          	$table->addRow(
				($no+$i), 
				$data[$i][id_kunjungan_radio], 
				$data[$i][no_rm], 
				$data[$i][nama], 
				tanggalIndo($data[$i][tgl_periksa], 'j M Y'), 
				$data[$i][asal], 
				$data[$i][pengirim], 
				$status_bayar
				/*,"<input type=\"button\" value=\"[  x  ]\" name=\"hapus\" class=\"inputan\" onclick=\"xajax_hapus_kunjungan_kamar_confirm('".$data[$i][id_kunjungan]."','".$data[$i][id_kunjungan_kamar]."', this)\" />"*/
				);
			if ($val[cara_masuk_p]=='PASIEN LUAR')
			{
				$table->addOnclickTd(
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')",
					"xajax_buka_kunjungan('".$data[$i][id_kunjungan_radio]."')"
				);
			}
			else
			{
				$table->addOnclickTd(
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')",
					"buka_daftar_penunjang('".$data[$i][id_kunjungan_kamar]."')"
				);	
			}
			
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
/*
BIKIN SESSION HAK DAN SIFAT, AGAR NGIRIT MEMORI DI MODAL KUNJUNGAN
*/
		$kon = new Konek;
		$kon->sql = "SELECT id, nama FROM hak ORDER BY nama";
		$kon->execute();
		$_SESSION[radio][hak] = $kon->getAll();

		$kon->sql = "SELECT * FROM sifat";
		$kon->execute();
		$_SESSION[radio][sifat] = $kon->getAll();


		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 15
0
	function list_semua_kunjungan($hal, $pasien_id) {
		$paging = new MyPagina;
		$paging->hal = $hal;
		$paging->rows_on_page = 5;
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				kk.no_antrian as no_antrian,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				kmr.nama as kamar,
				kk.tgl_periksa as tgl_periksa,
				d.nama as nama_dokter
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				p.id = '".$pasien_id."'
			ORDER BY 
				kk.id ASC
		";
		$paging->sql = $sql;
		$paging->onclick_func = "xajax_list_semua_kunjungan";
		$paging->setOnclickValue($pasien_id);
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$objResponse = new xajaxResponse();
		//$objResponse->addAssign('debug', 'innerHTML', $sql);
		$objResponse->addScriptCall("buka_semua_kunjungan");
		$ret .= "<br /><b>No.RM : " . $data[0][no_rm] . "</b>";
		$ret .= "<br /><b>Pasien : " . $data[0][nama] . "</b>";
		$ret .= "<hr />";

		for($i=0;$i<sizeof($data);$i++) {
			
			$ret .= "<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\">";
			$ret .= "<tr><td colspan=\"2\"><b>Kunjungan Ke-" . $data[$i][kunjungan_ke] ."</b></td></tr>";
			$ret .= "<tr><td style=\"width:150px\">Tanggal Kunjung</td><td>" . tanggalIndo($data[$i][tgl_periksa], "j F Y") . "</td></tr>";
			$ret .= "<tr><td>Pelayanan</td><td>" . $data[$i][kamar] . "</td></tr>";
			$ret .= "<tr><td>Dokter</td><td>" . $data[$i][nama_dokter] . "</td></tr>";
			$ret .= "</table>";
			$ret .= "<hr />";
		}
		$modal = new Modal;
		$modal->setNavi($navi);
		$modal->setTitle("Daftar Kunjungan");
		$modal->setContent($ret);
		$modal->setCloseButtonOnclick("tutup_semua_kunjungan()");
		$modal_cnt = $modal->build();
		//$objResponse->addAssign("list_semua_kunjungan_navi", "innerHTML", $navi);
		$objResponse->addAssign("list_semua_kunjungan", "innerHTML", $modal_cnt);
		return $objResponse;
	}
Esempio n. 16
0
	function list_data($hal=0, $semua_pasien = "0", $val="") {
		if($_SESSION[pelayanan_id]) $s = " AND pel.id = '" .$_SESSION[pelayanan_id]. "'";
		if($semua_pasien == "0") $s .= " AND kk.kelanjutan IS NULL";
		else {
			$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
			$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
			$s .= "AND DATE(kk.tgl_daftar) BETWEEN '".$tgl_daftar_dari."' AND '".$tgl_daftar_sampai."'";
		}
		
		$paging = new MyPagina;
		$paging->setOnclickValue("'".$semua_pasien."'", "xajax.getFormValues('form_kunjungan')");
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				kk.no_antrian as no_antrian,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				pel.nama as pelayanan,
				kmr.nama as kamar,
				kmr.kelas as kelas,
				kk.tgl_daftar as tgl_daftar,
				kk.tgl_keluar as tgl_keluar,
				d.nama as dokter,
				kk.kelanjutan as kelanjutan,
				rk.nomor as no_kamar
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN ref_kamar rk ON (rk.id = kk.no_kamar)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				pel.jenis = 'RAWAT INAP' 
		 		$s
			ORDER BY 
				kmr.nama, d.nama, kk.no_antrian
		";
		$paging->sql = $sql;
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();

		$_SESSION[hal] = $hal;

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 270;
		//$table->anime_bg_color = "";
		$table->addTh(
			"No", 
			"No.<br />Kjg",
			"No. RM", 
			"Pasien", 
			"Kamar", 
			"Dokter", 
			"Tgl<br />Masuk",
			"Tgl<br />Keluar",
			"Kelanjutan"
			/*,"Hapus"*/
		);
		$table->addExtraTh("style=\"width:30px;\"","style=\"width:30px;\"","style=\"width:80px;\"","style=\"width:200px;\"","","","","","",""/*,"style=\"width:70px;\""*/);
		$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
			/*
				id kelanjutan == 'PINDAH KAMAR' adalah kelanjutan pindah kamar
				jika id kelanjutan == 'PINDAH KAMAR' maka diedit, jika diedit, maka harus membawa id child yang merupakan pindahan dari kamar tersebut
				jika id kelanjutan != 'PINDAH KAMAR' maka ditambah
			*/
			if($data[$i][kelanjutan] == "PINDAH KAMAR") {
				$table->addExtraTr();
				$table->extra_td[$i][] = "";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
				$table->extra_td[$i][] = "style=\"background-color:#dcdcdc\"";
			} else $table->addExtraTr();
			$table->addRow(
				($no+$i), 
				$data[$i][id_kunjungan], 
				$data[$i][no_rm], 
				$data[$i][nama], 
				$data[$i][kamar], 
				$data[$i][dokter], 
				tanggalIndo($data[$i][tgl_daftar], 'j M Y') . "<br>" . tanggalIndo($data[$i][tgl_daftar], 'H:i'), 
				tanggalIndo($data[$i][tgl_keluar], 'j M Y') . "<br>" . tanggalIndo($data[$i][tgl_keluar], 'H:i'), 
				$data[$i][kelanjutan] 
				/*"<input type=\"button\" value=\"[  x  ]\" name=\"hapus\" class=\"inputan\" onclick=\"xajax_hapus_kunjungan_kamar_confirm('".$data[$i][id_kunjungan]."','".$data[$i][id_kunjungan_kamar]."', this)\" />"*/
			);
			if($data[$i][kelanjutan] == "PINDAH KAMAR") {
				//maka diedit
				/*
					mendapatkan kunjungan kamar setelah dipindah dengan parent id = id_kunjungan_kamar
					untuk diedit
				*/
				$kon->sql = "
					SELECT
						id
					FROM
						kunjungan_kamar
					WHERE
						parent_id = '".$data[$i][id_kunjungan_kamar]."'
				";
				$kon->execute();
				$stl_pindah = $kon->getOne();
				$table->addOnclickTd(
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')",
					"xajax_buka_edit_pindah_kamar('".$data[$i][id_kunjungan_kamar]."', '".$stl_pindah[id]."')"
				);

			} else {
				$table->addOnclickTd(
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_pindah_kamar('".$data[$i][id_kunjungan_kamar]."')"
				);
			}
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 17
0
       function cari_obat($hal = 0, $val) {
         $val[obat] = addslashes($val[obat]);
         $q = " AND nama LIKE '%".$val[obat]."%' ";
         $paging = new MyPagina;
         $paging->rows_on_page = 10;
         $paging->hal = $hal;

        /*$paging->sql = "
				SELECT
					id as id,
					REPLACE(nama, '".$val[bhp]."','<b>".$val[bhp]."</b>') as nama_replace,
					nama as nama,
					biaya as biaya
				FROM
					bhp
				WHERE
					1=1
					$q
				ORDER BY
					nama
			";*/

          $paging->sql = "select db_apotek.ms_barang.id as id, db_apotek.ms_barang.kd_barang as kd_barang,db_apotek.ms_barang.nama as nama,
          barang_unit.stok as stok, db_apotek.barang_unit.fld02 as biaya from db_apotek.ms_barang, db_apotek.barang_unit 
where db_apotek.ms_barang.id = db_apotek.barang_unit.barang_id and db_apotek.barang_unit.unit_id =4";  


         $paging->onclick_func = "xajax_cari_obat";
         $paging->setOnclickValue("xajax.getFormValues('cari_obat')");
         $paging->get_page_result();

         $bhp_data = $paging->data;
         $bhp_no = $paging->start_number();
         $bhp_navi = $paging->navi();


         $objResponse = new xajaxResponse();

         $table = new Table;
         $table->tbody_height = 200;
         $table->addTh("No", "Obat", "Harga");
         $table->addExtraTh("style=\"width:30px\"", "", "");
         for($i = 0; $i < sizeof($bhp_data); $i++) {
            $table->addRow(($bhp_no + $i), $bhp_data[$i]['nama'], uangIndo($bhp_data[$i]['biaya']));
            $table->addOnclickTd("xajax_get_obat(".$bhp_data[$i]['id'].", '".addslashes($bhp_data[$i]['nama']).
               "', '".($bhp_data[$i]['biaya'])."');", "xajax_get_obat(".$bhp_data[$i]['id'].", '".
               addslashes($bhp_data[$i]['nama'])."', '".($bhp_data[$i]['biaya'])."');",
               "xajax_get_obat(".$bhp_data[$i]['id'].", '".addslashes($bhp_data[$i]['nama']).
               "', '".($bhp_data[$i]['biaya'])."');");
         }
         $tabel = $table->build();
         $objResponse->addAssign("bhp_navi", "innerHTML", $bhp_navi);
         $objResponse->addAssign("list_bhp", "innerHTML", $tabel);
         return $objResponse;
      }
Esempio n. 18
0
	function list_data($hal = 0, $val) {
		$paging = new MyPagina;
		$objResponse = new xajaxResponse();
		
		if($val[is_cari] == "1") {
			if($val[cari_id]) {
				$q = " AND p.id = '".$val[cari_id]."' ";
			} else {
				if($val[cari_nama]) $q .= " AND p.nama LIKE '%".$val[cari_nama]."%' ";
				if($val[cari_sex]) $q .= " AND p.sex = '".$val[cari_sex]."' ";
				if($val[cari_alamat]) $q .= " AND p.alamat LIKE '%".$val[cari_alamat]."%' ";
				if($val[cari_rt]) $q .= " AND p.rt LIKE '%".$val[cari_rt]."%' ";
				if($val[cari_rw]) $q .= " AND p.rw LIKE '%".$val[cari_rw]."%' ";

				if($val[cari_desa_id]) $q .= " AND des.id = '".$val[cari_desa_id]."' ";
				elseif($val[cari_kecamatan_id]) $q .= " AND kec.id = '".$val[cari_kecamatan_id]."' ";
				elseif($val[cari_kabupaten_id]) $q .= " AND kab.id = '".$val[cari_kabupaten_id]."' ";
				elseif($val[cari_propinsi_id]) $q .= " AND prop.id = '".$val[cari_propinsi_id]."' ";
			}
		}
		$sql = "
			SELECT 
				p.id as id, 
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as id_display,
				REPLACE((p.nama), ('".$val[cari_nama]."'), ('<b>".$val[cari_nama]."</b>')) as nama,
				CONCAT(p.alamat, ' ', 'RT ', p.rt, '/ RW ', p.rw, '<br />',des.nama, ', ', kec.nama, ', ', kab.nama, '<br />', prop.nama) as alamat
			FROM 
				pasien p 
				JOIN ref_desa des ON (des.id = p.desa_id)
				JOIN ref_kecamatan kec ON (kec.id = des.kecamatan_id)
				JOIN ref_kabupaten kab ON (kab.id = kec.kabupaten_id)
				JOIN ref_propinsi prop ON (prop.id = kab.propinsi_id)
			WHERE
				1=1
				$q
			ORDER BY p.nama
			";
			//echo $sql;
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$paging->hal = $hal;
		$paging->sql = $sql;
		$paging->setOnclickValue("xajax.getFormValues('cari_pasien')");
		$paging->get_page_result();
		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 270;
		$table->addTh("No", "No. RM", "NAMA", "ALAMAT", "HAPUS");
		$table->addExtraTh(" style=\"width:40px\" ", " style=\"width:100px\" ", " style=\"width:200px\" ", "", " style=\"width:50px\" ");
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][id_display], 
				$data[$i][nama], 
				$data[$i][alamat], 
				"<input type=\"button\" value=\"[  x  ]\" name=\"hapus\" class=\"inputan\" onclick=\"xajax_hapus_pasien_confirm('".$data[$i][id]."', '')\" />"
			);

			$table->addOnclickTd(
				"xajax_get_pasien('".$data[$i][id]."')",
				"xajax_get_pasien('".$data[$i][id]."')",
				"xajax_get_pasien('".$data[$i][id]."')",
				"xajax_get_pasien('".$data[$i][id]."')"
			);
		}
		$ret = $table->build();
		$objResponse->addAssign("cari_navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 19
0
	function cari_imunisasi($hal = 0, $val) {
		$val[imunisasi] = addslashes($val[imunisasi]);
		$q = " AND nama LIKE '%".$val[imunisasi]."%' ";
		$paging = new MyPagina;
		$paging->rows_on_page = 10;
		$paging->hal = $hal;
		
		$paging->sql = "
			SELECT 
				id,
				REPLACE(UPPER(nama), '".$val[imunisasi]."','<b>".$val[imunisasi]."</b>') as nama,
				usia
			FROM 
				imunisasi
			WHERE
				1 = 1 
				$q
			ORDER BY 
				nama
			";
		
		$paging->onclick_func = "xajax_cari_imunisasi";
		$paging->setOnclickValue("xajax.getFormValues('cari_imunisasi')");
		$paging->get_page_result();

		$imunisasi_data = $paging->data;
		$imunisasi_no = $paging->start_number();
		$imunisasi_navi = $paging->navi();
		
		$objResponse = new xajaxResponse();
		$table = new Table;
		$table->addTh("No", "Nama", "Usia");
		$table->addExtraTh("style=\"width:40px\"", "style=\"width:200px\"");
		
		for($i=0;$i<sizeof($imunisasi_data);$i++) {
			$table->addRow(($imunisasi_no+$i), $imunisasi_data[$i]['nama'], $imunisasi_data[$i]['usia']);
			$table->addOnclickTd(
				"get_imunisasi(" . $imunisasi_data[$i][id] . ", '" . addslashes($imunisasi_data[$i]['nama']) . "', '".$val[add_btn_imunisasi_again]."');",
				"get_imunisasi(" . $imunisasi_data[$i][id] . ", '" . addslashes($imunisasi_data[$i]['nama']) . "', '".$val[add_btn_imunisasi_again]."');",
				"get_imunisasi(" . $imunisasi_data[$i][id] . ", '" . addslashes($imunisasi_data[$i]['nama']) . "', '".$val[add_btn_imunisasi_again]."');"
			);
		}
		$tabel = $table->build();
		$objResponse->addAssign("imunisasi_navi", "innerHTML", $imunisasi_navi);
		$objResponse->addAssign("list_imunisasi","innerHTML", $tabel);
		return $objResponse;
	}
Esempio n. 20
0
	function list_data($hal = 0) {
		$paging = new MyPagina;
		$paging->sql = "
			SELECT 
				k.id as id, 
				pel.id as pelid,
				pel.nama as pel,
				k.nama as nama,
				k.jml_bed as jml_bed,
				k.kelas as kelas,
                k.tarif_umum as tarif_umum, k.tarif_asuransi
			FROM 
				pelayanan pel
				JOIN kamar k ON (k.pelayanan_id = pel.id)
			WHERE
				pel.jenis = 'RAWAT INAP'
			ORDER BY pel.nama, k.kelas, k.nama";
		$paging->rows_on_page = 15;
		$paging->hal = $hal;
		$_SESSION[modul_setting][kamar][hal] = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 350;
		$table->addTh(
			"No", 
			"Nama Bangsal", 
			"Kamar", 
			"Kelas",
			"Jml<br />TT", 
            "Tarif Umum",
            "Tarif asuransi",
			"Hapus"
		);
		$table->addExtraTh("style=\"width:50px;\"","style=\"width:200px;\"","","","","","","style=\"width:70px;\"");
		$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][pelid] == $data[$i-1][pelid])
				$pel = "";
			else {
				$kon->sql = "SELECT SUM(jml_bed) as jml FROM kamar WHERE pelayanan_id = '".$data[$i][pelid]."'";
				$kon->execute();
				$tt = $kon->getOne();
				$pel = "<b>" . $data[$i][pel] . "</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" . $tt[jml] . " tt]";
			}
			$table->addRow(
				($no+$i), 
				$pel, 
				$data[$i][nama],
				$data[$i][kelas], 
				$data[$i][jml_bed],"<align=right>".number_format($data[$i][tarif_umum]),number_format($data[$i][tarif_asuransi]), 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kamar('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>"
			);
			$table->addOnclickTd(
				"xajax_get_kamar('".$data[$i][id]."')", 
				"xajax_get_kamar('".$data[$i][id]."')", 
				"xajax_get_kamar('".$data[$i][id]."')", 
				"xajax_get_kamar('".$data[$i][id]."')", 
				"xajax_get_kamar('".$data[$i][id]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 21
0
      function list_data($hal = 0, $val) {
         $paging = new MyPagina;
         $objResponse = new xajaxResponse();
		
		
		 if($val[is_cari] == "1") {
            if($val[cari_id]) {
               $q = " AND p.id = '".$val[cari_id]."' ";
            } else {
               if($val[cari_nama]) $q .= " AND p.nama LIKE '%".$val[cari_nama]."%' ";
               if($val[cari_sex]) $q .= " AND p.sex = '".$val[cari_sex]."' ";
               if($val[cari_alamat]) $q .= " AND p.alamat LIKE '%".$val[cari_alamat]."%' ";
               if($val[cari_rt]) $q .= " AND p.rt LIKE '%".$val[cari_rt]."%' ";
               if($val[cari_rw]) $q .= " AND p.rw LIKE '%".$val[cari_rw]."%' ";
               if($val[cari_telp]) $q .= " AND p.telp LIKE '%".$val[cari_telp]."%' "; 
               /*if($tgl_lahir) $q .= " AND DATE(p.tgl_lahir) = '".$tgl_lahir."' "; */
			   if ($val[tgl_lahir_thn] == "" && $val[tgl_lahir_bln] == "" && $val[tgl_lahir_tgl] == ""){
						$tgl_lahir = "";
						}
				else {
						$tgl_lahir = $val[tgl_lahir_thn] . "-" . $val[tgl_lahir_bln] . "-" . $val[tgl_lahir_tgl];   
						$q .= " AND DATE(p.tgl_lahir) = '".$tgl_lahir."' ";
					} 
               if($val[cari_desa_id]) $q .= " AND des.id = '".$val[cari_desa_id]."' ";
               elseif($val[cari_kecamatan_id]) $q .= " AND kec.id = '".$val[cari_kecamatan_id].
                     "' ";
               elseif($val[cari_kabupaten_id]) $q .= " AND kab.id = '".$val[cari_kabupaten_id].
                     "' ";
               elseif($val[cari_propinsi_id]) $q .= " AND prop.id = '".$val[cari_propinsi_id].
                     "' ";
            }
         }     
          $sql = "
				SELECT
					p.id as id,
					CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as id_display,
					REPLACE((p.nama), ('".$val[cari_nama]."'), ('<b>".$val[cari_nama].
            "</b>')) as nama,
					CONCAT(p.alamat, ' ', 'RT ', p.rt, '/ RW ', p.rw, '<br />',des.nama, ', ', kec.nama, ', ', kab.nama, '<br />', prop.nama) as alamat
				FROM
					pasien p
					LEFT OUTER JOIN ref_desa des ON (des.id = p.desa_id)
					LEFT OUTER JOIN ref_kecamatan kec ON (kec.id = des.kecamatan_id)
					LEFT OUTER JOIN ref_kabupaten kab ON (kab.id = kec.kabupaten_id)
					LEFT OUTER JOIN ref_propinsi prop ON (prop.id = kab.propinsi_id)
				WHERE
					1=1
					$q
				ORDER BY p.nama
				";
         //echo $sql;
         //$objResponse->addAssign("debug", "innerHTML", $sql);
         $paging->hal = $hal;
         $paging->sql = $sql;
         $paging->setOnclickValue("xajax.getFormValues('cari_pasien')");
         $paging->get_page_result();
         $data = $paging->data;
         $no = $paging->start_number();
         $navi = $paging->navi();

         $table = new Table;
         $table->tbody_height = 270;
         $table->addTh("No", "No. RM", "NAMA", "ALAMAT", "HAPUS");
         $table->addExtraTh(" style=\"width:40px\" ", " style=\"width:100px\" ", " style=\"width:200px\" ",
            "", " style=\"width:50px\" ");
         for($i = 0; $i < sizeof($data); $i++) {
            $table->addRow(($no + $i), $data[$i][id_display], $data[$i][nama], $data[$i][alamat],
               "<a href=\"javascript:void(0)\" title=\"Hapus Pasien\" onclick=\"hapus_pasien('".
               $data[$i][id]."', 'tr_".$i."')\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL.
               "remove.png\" alt=\"Hapus Pasien\" border=\"0\" /></a>");
            $table->addExtraTr("id=\"tr_".$i."\"");

            $table->addOnclickTd("xajax_get_pasien('".$data[$i][id]."')",
               "xajax_get_pasien('".$data[$i][id]."')", "xajax_get_pasien('".$data[$i][id].
               "')", "xajax_get_pasien('".$data[$i][id]."')");
         }
         $ret = $table->build();
         $objResponse->addAssign("cari_navi", "innerHTML", $navi);
         $objResponse->addAssign("list_data", "innerHTML", $ret);
         return $objResponse;
      }
Esempio n. 22
0
	function list_data($hal = 0, $val) {
		if(!empty($val)) {
			$val[cari_nama] = addslashes($val[cari_nama]);
			$q = " AND (kode_icd_group LIKE '%".$val[cari_nama]."%' OR kode_icd LIKE '%".$val[cari_nama]."%' OR no_dtd LIKE '%".$val[cari_nama]."%' OR nama LIKE '%".$val[cari_nama]."%' OR gol_sebab_sakit LIKE '%".$val[cari_nama]."%')";
		}
		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->setOnclickValue("xajax.getFormValues('form_icd')");

		$paging->sql = "
			SELECT 
				id,
				REPLACE(kode_icd_group, '".$val[cari_nama]."','<b>".$val[cari_nama]."</b>') as kode_icd_group,
				REPLACE(kode_icd, '".$val[cari_nama]."','<b>".$val[cari_nama]."</b>') as kode_icd,
				REPLACE(no_dtd, '".$val[cari_nama]."','<b>".$val[cari_nama]."</b>') as no_dtd,
				REPLACE(nama, '".$val[cari_nama]."','<b>".$val[cari_nama]."</b>') as nama,
				REPLACE(gol_sebab_sakit, '".$val[cari_nama]."','<b>".$val[cari_nama]."</b>') as gol_sebab_sakit
			FROM 
				icd 
			WHERE 
				1=1 
				$q
			ORDER BY
				kode_icd
		";
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();
		$_SESSION[modul_setting][penyakit][hal] = $hal;

		$tabel = new Table;
		$tabel->tbody_height = 300;
		$tabel->addTh("No", "Kode ICD Group", "Kode ICD", "No. DTD", "Nama Penyakit", "Gol. Sebab Sakit", "Hapus");
		$tabel->addExtraTh(" style=\"width: 50px;\"", " style=\"width: 50px;\"", " style=\"width: 70px;\" ", " style=\"width: 70px;\" ", "", "", " style=\"width: 70px;\" ");

		for($i=0;$i<sizeof($data);$i++) {
			$tabel->addExtraTr("id=\"tr_".$i."\"");
			$tabel->addRow(
				($no+$i), 
				$data[$i][kode_icd_group], 
				$data[$i][kode_icd], 
				$data[$i][no_dtd], 
				$data[$i][nama], 
				$data[$i][gol_sebab_sakit], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_icd('".$data[$i][id]."', 'tr_".$i."')\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			$tabel->addOnclickTd(
				"xajax_get_icd('".$data[$i][id]."')", 
				"xajax_get_icd('".$data[$i][id]."')", 
				"xajax_get_icd('".$data[$i][id]."')", 
				"xajax_get_icd('".$data[$i][id]."')", 
				"xajax_get_icd('".$data[$i][id]."')", 
				"xajax_get_icd('".$data[$i][id]."')"
			);
		}

		$buka = $tabel->build();
		$objResponse->addAssign("list_data", "innerHTML", $buka);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		return $objResponse;
	}
Esempio n. 23
0
	public function paginationQuery($query){
		$items 										=	self::getItems();
		$pagination_array							=	array();
		$pagination 								= 	new MyPagina ();
		$pagination->sql 							= 	$query ;
	    $pagination->rows_on_page					=	$items;
	    $pagination_array['max_page']	 			=	$pagination->get_num_pages();
		$pagination_array['result']					=	$pagination->get_page_result();
		$pagination_array['num_rows']				=	$pagination->get_page_num_rows();
		$pagination_array['PAGINATION_LINKS']		=	$pagination->navigation(" | ", " | ");
		$pagination_array['PAGINATION_INFO']		=	$pagination->page_info();
		$pagination_array['PAGINATION_TOTALRECS']	=	$pagination->get_total_rows();

		return $pagination_array;
	}
Esempio n. 24
0
	function list_data($hal=0, $val="") {	  
	   $kon = new konek;
       	if($val[pasien_id]) {
			$q = " p.no_rm = '".$val[pasien_id]."' ";
		} elseif($val[nama]) {
			$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
			$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl]; 
			$q = " p.nama LIKE '%".$val[nama]."%' AND DATE(kk.tgl_daftar) BETWEEN '".$tgl_daftar_dari."' AND '".$tgl_daftar_sampai."' ";
		} elseif ($val[pilih]){
			$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
			$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
			$q = " DATE(kk.tgl_daftar) BETWEEN '".$tgl_daftar_dari."' AND '".$tgl_daftar_sampai."' ";
        }elseif ($val[telp]){
            $q = " p.telp LIKE '%".$val[telp]."%' ";
		}
		//$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
		//$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
		$paging = new MyPagina;
		$paging->setOnclickValue("xajax.getFormValues('form_kunjungan')");
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				kk.no_antrian as no_antrian,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				pel.nama as pelayanan,
				kmr.nama as kamar,
				kk.tgl_daftar as tgl_daftar,
				kk.tgl_periksa as tgl_periksa,
				d.nama as dokter,
				kk.kelanjutan as kelanjutan,
				pel.jenis as jenis
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)

				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				$q
			ORDER BY 
				k.id DESC, kk.id ASC
		";
		$paging->sql = $sql;
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();

		$_SESSION[hal] = $hal;

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 310;
		$table->anime_bg_color = "";
		$table->addTh(
			"No", 
			"No.<br />Kjg",
			"No. RM", 
			"Pasien", 
			"Kjg<br />Ke", 
			"No<br />Antri", 
			"Pelayanan", 
			"Dokter", 
			"Tgl<br />Daftar",
			"Tgl<br />Periksa",
            "Kunjungan <br/>Terakhir",
			"Kelanjutan",
			"Hapus"
		);
		$table->addExtraTh("style=\"width:30px;\"","style=\"width:30px;\"","style=\"width:80px;\"","style=\"width:200px;\"","","","","","","","","style=\"width:70px;\"");
		for($i=0;$i<sizeof($data);$i++) {
		     $kunj_sbl = $data[$i][kunjungan_ke]-1 ; 
            $sql_kunjungan = "select kk.tgl_daftar as tgl_daftar from kunjungan k,pasien p, kunjungan_kamar kk
                             where p.id = k.pasien_id 
                             and k.id = kk.kunjungan_id
                             and p.id = '".$data[$i][pasien_id]."'
                             and LAST_INSERT_ID(k.id) 
                             and k.kunjungan_ke ='".$kunj_sbl."'
                             ORDER BY k.id DESC LIMIT 1";
            $kon->sql = $sql_kunjungan;
            $kon->execute();
            $k = $kon->getOne();
            
            if (empty($k[tgl_daftar])):
               $tgl_daftar = '-';
            else:
               $tgl_daftar = $k[tgl_daftar];
            endif;
            
			if($data[$i][jenis] == 'RAWAT INAP') {
				$table->addExtraTr("style=\"background-color:#dcdcdc\"");
			} else $table->addExtraTr();
			$table->addRow(
				($no+$i), 
				$data[$i][id_kunjungan], 
				$data[$i][no_rm], 
				$data[$i][nama], 
				$data[$i][kunjungan_ke], 
				$data[$i][no_antrian], 
				$data[$i][kamar], 
				$data[$i][dokter], 
				tanggalIndo($data[$i][tgl_daftar], 'j M Y'), 
				tanggalIndo($data[$i][tgl_periksa], 'j M Y'), 
                $tgl_daftar,
				$data[$i][kelanjutan], 
				"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kunjungan_kamar('".$data[$i][id_kunjungan]."','".$data[$i][id_kunjungan_kamar]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
			if($data[$i][jenis] == 'RAWAT INAP') {
				//jika rawat inap, maka diedit
				$table->addOnclickTd(
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')",
					"xajax_buka_edit_ranap('".$data[$i][id_kunjungan_kamar]."', '".$data[$i-1][id_kunjungan_kamar]."')"
				);

			} elseif($data[$i][kelanjutan] == "DIRAWAT" && $data[$i][pasien_id] == $data[$i+1][pasien_id] && $data[$i+1][jenis] == 'RAWAT INAP') {
				$table->addOnclickTd(
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')",
					"alert('Pasien sudah mendaftar rawat inap')"
				);
			} else {
				$table->addOnclickTd(
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')",
					"xajax_buka_daftar_ranap('".$data[$i][id_kunjungan_kamar]."')"
				);
			}
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 25
0
	function list_data($hal=0, $semua_pasien = "0", $val="") {
		if($_SESSION[pelayanan_id]) $s = " AND pel.id = '" .$_SESSION[pelayanan_id]. "'";
		if($semua_pasien == "0") $s .= " AND kk.kelanjutan IS NULL";
		else {
			$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
			$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
			$s .= "AND DATE(kk.tgl_daftar) BETWEEN '".$tgl_daftar_dari."' AND '".$tgl_daftar_sampai."'";
		}
		
		$paging = new MyPagina;
		$paging->setOnclickValue("'".$semua_pasien."'", "xajax.getFormValues('form_kunjungan')");
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				kk.parent_id as parent_id,
				k.kunjungan_ke as kunjungan_ke,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				pel.nama as pelayanan,
				kmr.nama as kamar,
				kmr.kelas as kelas,
				kk.tgl_daftar as tgl_daftar,
				kk.tgl_periksa as tgl_periksa,
				kk.tgl_keluar as tgl_keluar,
				d.nama as dokter,
				kk.kelanjutan as kelanjutan,
				CASE WHEN (kk.tgl_keluar IS NULL) THEN DATEDIFF(DATE(NOW()), kk.tgl_daftar)
				ELSE DATEDIFF(kk.tgl_keluar, kk.tgl_daftar) END as lama_dirawat
				
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				pel.jenis = 'RAWAT INAP'
		 		$s
			ORDER BY 
				kmr.nama, d.nama, kk.no_antrian
		";
		$paging->sql = $sql;
		$paging->rows_on_page = 10;
		$paging->hal = $hal;
		$paging->get_page_result();

		$_SESSION[hal] = $hal;

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 310;
		$table->addTh(
			"No", 
			"No.<br />Kjg",
			"No. RM", 
			"Pasien", 
			"Kjg<br />Ke", 
			"Kamar", 
			"Dokter", 
			"Tgl<br />Masuk",
			"Tgl<br />Keluar",
			"Lama<br />Dirawat<br />(hari)",
			"Kelanjutan"
			/*,"Hapus"*/
		);
		$table->addExtraTh(
			"style=\"width:50px;\"",
			"style=\"width:50px;\"",
			"style=\"width:80px;\"",
			"style=\"width:200px;\"",
			"",
			"",
			"",
			"",
			"",
			"",
			""
			/*,"style=\"width:70px;\""*/
		);
		$x = 0;
		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][lama_dirawat] == 0) $lama_dirawat = 1;
			else $lama_dirawat = $data[$i][lama_dirawat];
			$table->addRow(
				($no+$i), 
				$data[$i][id_kunjungan], 
				$data[$i][no_rm], 
				$data[$i][nama], 
				$data[$i][kunjungan_ke], 
				$data[$i][kamar], 
				$data[$i][dokter], 
				tanggalIndo($data[$i][tgl_daftar], 'j M Y') . "<br>" . tanggalIndo($data[$i][tgl_daftar], 'H:i'), 
				tanggalIndo($data[$i][tgl_keluar], 'j M Y') . "<br>" . tanggalIndo($data[$i][tgl_keluar], 'H:i'), 
				$lama_dirawat, 
				$data[$i][kelanjutan]
				/*,"<input type=\"button\" value=\"[  x  ]\" name=\"hapus\" class=\"inputan\" onclick=\"xajax_hapus_kunjungan_kamar_confirm('".$data[$i][id_kunjungan]."','".$data[$i][id_kunjungan_kamar]."', this)\" />"*/
				);
			$table->addOnclickTd(
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."', '".$data[$i][parent_id]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
Esempio n. 26
0
	function buka_list_kunjungan($hal=0, $pasien_id) {
		$paging = new MyPagina;
         $objResponse = new xajaxResponse();
		$paging->onclick_func = "xajax_buka_list_kunjungan";
		$paging->setOnclickValue("'".$pasien_id."'");
		$paging->rows_on_page = 5;
		$paging->hal = $hal;
		$sql = "
			SELECT 
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.nama as nama,
                p.id as pasien_id,
				p.sex as sex,
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				pel.jenis as jenis_pelayanan,
				pel.nama as pelayanan,
				kmr.nama as kamar,
				kk.tgl_periksa as tgl_periksa,
                kk.tgl_daftar as tgl_daftar,
				CONCAT(i.kode_icd,' - ', i.nama) as diagnosa,
				d.nama as dokter
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
				LEFT JOIN icd i ON (i.id = kk.diagnosa_utama_id)
				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				p.id = '".$pasien_id."'
			GROUP BY
				kk.id
			ORDER BY 
				kk.id
		";
		$paging->sql = $sql;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 300;
		$table->addTh(
			"No", 
			"Kunjungan Ke/<br />Tanggal Kunjung", 
			"Pemeriksaan"
		);	
		$table->addExtraTh(
			"style=\"width:30px;\"",
			"style=\"width:90px;\"",
			""
		);
		$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
		
			//get data tindakan
			$kon->sql = "
				SELECT
					kkic.id as kunjungan_tindakan_id,
					ic.id as tindakan_id,
					ic.nama as tindakan_nama
				FROM
					kunjungan_kamar_icopim kkic
					JOIN icopim ic ON (ic.id = kkic.icopim_id)
				WHERE
					kkic.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY 
					kkic.id
			";
			$kon->execute();
			$data_ic = $kon->getAll();
            //get obat
		    //bln/tgl/thn
            $temp_tgl ="";
            $temp_tgl = explode('/',DATE($data[$i][tgl_periksa]));
            $tgl_obat =$temp_tgl[2].$temp_tgl[0].$temp_tgl[1];
            
            $kon->sql = "SELECT db_apotek.ms_barang.nama as nama,db_apotek.resep_head.no_resep as no_resep 
                         FROM db_apotek.resep,db_apotek.resep_head,simrs.pasien,db_apotek.ms_barang 
                         WHERE db_apotek.resep.no_resep = db_apotek.resep_head.no_resep 
                         AND simrs.pasien.id = db_apotek.resep_head.pasien_id 
                         AND db_apotek.ms_barang.kd_barang = resep.kode_obat
                          AND DATE(db_apotek.resep_head.created_datetime)='".$tgl_obat."'
                         AND db_apotek.resep.pasien_id='".$data[$i][pasien_id]."'";
                         
            $kon->execute();
			$data_bhp = $kon->getAll(); 
        
        
			//get data bhp
            //get obat
			/*$kon->sql = "
				SELECT
					kkbhp.id as kunjungan_bhp_id,
					kkbhp.bhp_id as bhp_id,
					db_apotek.ms_barang.nama as bhp_nama,
                    db_apotek.ms_barang.stok,
                    kkbhp.no_resep as resep
				FROM
					kunjungan_bayar kkbhp,
					db_apotek.ms_barang
				WHERE
					kkbhp.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
                    and kkbhp.bhp_id = db_apotek.ms_barang.id
				GROUP BY 
					kkbhp.id
			";
			$kon->execute();
			$data_bhp = $kon->getAll();*/
			
			//get data lab
			$kon->sql = "
				SELECT
					kblab.nama as nama
				FROM
					kunjungan_bayar kblab
					JOIN lab_kunjungan lklab ON (lklab.id = kblab.lab_kunjungan_id)
	                JOIN kunjungan_kamar kklab ON (kklab.id = lklab.kunjungan_kamar_id)
				WHERE
					kblab.lab_specimen_id IS NOT NULL
					AND kklab.id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY 
					kblab.id
			";
			$kon->execute();
			$data_lab = $kon->getAll();
			
			//get data radiologi
			$kon->sql = "
				SELECT
					kbrad.nama as nama
				FROM
					kunjungan_bayar kbrad
					JOIN radio_kunjungan lkrad ON (lkrad.id = kbrad.radio_kunjungan_id)
	                JOIN kunjungan_kamar kkrad ON (kkrad.id = lkrad.kunjungan_kamar_id)
				WHERE
					kbrad.radio_pemeriksaan_id IS NOT NULL
					AND kkrad.id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY 
					kbrad.id
			";
			$kon->execute();
			$data_rad = $kon->getAll();
/*
			//get data im
			$kon->sql = "
				SELECT
					kki.id as kunjungan_imunisasi_id,
					im.id as imunisasi_id,
					im.nama as imunisasi_nama
				FROM
					kunjungan_kamar_imunisasi kki
					JOIN imunisasi im ON (im.id = kki.imunisasi_id)
				WHERE
					kki.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY
					kki.id
			";
			$kon->execute();
			$data_im = $kon->getAll();
			*/
			$pem = "<ul>";
			
			$pem .= "<li><b>Pelayanan :</b> " . $data[$i][jenis_pelayanan] . " - " . $data[$i][kamar] . "</li>";
			$pem .= "<li><b>Dokter :</b> " . (empty($data[$i][dokter])?"-":$data[$i][dokter]) . "</li>";
			$pem .= "<li><b>Diagnosa :</b> " . (empty($data[$i][diagnosa])?"-":"<br />".$data[$i][diagnosa]) . "</li>";
			$pem .= "<li><b>Tindakan :</b> ";
				if(!empty($data_ic)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_ic);$j++) {
						$pem .= "<li>" . $data_ic[$j][tindakan_nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
		  $pem .= "<li><b>BHP (OBAT):</b> ";
            if(!empty($data_bhp)) {
               $pem .= "<ol>";
               for($j = 0; $j < sizeof($data_bhp); $j++) {
                  $pem .= "<li>".$data_bhp[$j][no_resep]." ".$data_bhp[$j][nama]."</li>";
               }
               $pem .= "</ol>";
            } else $pem .= "-";
            $pem .= "</li>";
			$pem .= "<li><b>Laboratorium:</b> ";
				if(!empty($data_lab)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_lab);$j++) {
						$pem .= "<li>" . $data_lab[$j][nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			$pem .= "<li><b>Radiologi:</b> ";
				if(!empty($data_rad)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_rad);$j++) {
						//$jml=sizeof($data_rad);
						$pem .= "<li>" . $data_rad[$j][nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			/*
			$pem .= "<li><b>Imunisasi :</b> ";
				if(!empty($data_im)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_im);$j++) {
						$pem .= "<li>" . $data_im[$j][imunisasi_nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			*/
			$pem .= "</ul>";
			$table->addRow(
				($no+$i), 
				$data[$i][kunjungan_ke] . "<hr />" . tanggalIndo($data[$i][tgl_periksa], 'j M Y'),
				$pem
				);
			/*
			$table->addOnclickTd(
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')"
			);
			*/
       
		$objResponse->addAssign("debug", "innerHTML", $tgl_obat);
		}
		$ret = $table->build();
		
		$objResponse->addAssign("modal_list_kunjungan", "style.display", "");
		$objResponse->addAssign("tab_list_semua_kunjungan_navi", "innerHTML", $navi);
		$objResponse->addAssign("mlk_no_rm", "innerHTML", $data[0][no_rm]);
		$objResponse->addAssign("mlk_nama", "innerHTML", $data[0][nama]);
		$objResponse->addAssign("mlk_sex", "innerHTML", $data[0][sex]);
		$objResponse->addAssign("tab_list_semua_kunjungan", "innerHTML", $ret);
		$objResponse->addScriptCall("disable_mainbar", "#E5E6E1");
		return $objResponse;
	}
Esempio n. 27
0
	function buka_list_kunjungan($hal=0, $pasien_id) {
		$paging = new MyPagina;
		$paging->onclick_func = "xajax_buka_list_kunjungan";
		$paging->setOnclickValue("'".$pasien_id."'");
		$paging->rows_on_page = 5;
		$paging->hal = $hal;
		$sql = "
			SELECT 
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.nama as nama,
				p.sex as sex,
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				pel.jenis as jenis_pelayanan,
				pel.nama as pelayanan,
				kmr.nama as kamar,
				kk.tgl_periksa as tgl_periksa,
				CONCAT(i.kode_icd,' - ', i.nama) as diagnosa,
				d.nama as dokter
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
				LEFT JOIN icd i ON (i.id = kk.diagnosa_utama_id)
				LEFT JOIN dokter d ON (d.id = kk.dokter_id)
			WHERE
				p.id = '".$pasien_id."'
			GROUP BY
				kk.id
			ORDER BY 
				kk.id
		";
		$paging->sql = $sql;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 300;
		$table->addTh(
			"No", 
			"Kunjungan Ke/<br />Tanggal Kunjung", 
			"Pemeriksaan"
		);	
		$table->addExtraTh(
			"style=\"width:30px;\"",
			"style=\"width:90px;\"",
			""
		);
		$kon = new Konek;
		for($i=0;$i<sizeof($data);$i++) {
		
			//get data tindakan
			$kon->sql = "
				SELECT
					kkic.id as kunjungan_tindakan_id,
					ic.id as tindakan_id,
					ic.nama as tindakan_nama
				FROM
					kunjungan_kamar_icopim kkic
					JOIN icopim ic ON (ic.id = kkic.icopim_id)
				WHERE
					kkic.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY 
					kkic.id
			";
			$kon->execute();
			$data_ic = $kon->getAll();

		
			//get data bhp
			$kon->sql = "
				SELECT
					kkbhp.id as kunjungan_bhp_id,
					bhp.id as bhp_id,
					bhp.nama as bhp_nama
				FROM
					kunjungan_bayar kkbhp
					JOIN bhp ON (bhp.id = kkbhp.bhp_id)
				WHERE
					kkbhp.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY 
					kkbhp.id
			";
			$kon->execute();
			$data_bhp = $kon->getAll();
			/*
			//get data im
			$kon->sql = "
				SELECT
					kki.id as kunjungan_imunisasi_id,
					im.id as imunisasi_id,
					im.nama as imunisasi_nama
				FROM
					kunjungan_kamar_imunisasi kki
					JOIN imunisasi im ON (im.id = kki.imunisasi_id)
				WHERE
					kki.kunjungan_kamar_id = '".$data[$i][id_kunjungan_kamar]."'
				GROUP BY
					kki.id
			";
			$kon->execute();
			$data_im = $kon->getAll();
			*/
			$pem = "<ul>";
			
			$pem .= "<li><b>Pelayanan :</b> " . $data[$i][jenis_pelayanan] . " - " . $data[$i][kamar] . "</li>";
			$pem .= "<li><b>Dokter :</b> " . (empty($data[$i][dokter])?"-":$data[$i][dokter]) . "</li>";
			$pem .= "<li><b>Diagnosa :</b> " . (empty($data[$i][diagnosa])?"-":"<br />".$data[$i][diagnosa]) . "</li>";
			$pem .= "<li><b>Tindakan :</b> ";
				if(!empty($data_ic)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_ic);$j++) {
						$pem .= "<li>" . $data_ic[$j][tindakan_nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			$pem .= "<li><b>BHP :</b> ";
				if(!empty($data_bhp)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_bhp);$j++) {
						$pem .= "<li>" . $data_bhp[$j][bhp_nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			/*
			$pem .= "<li><b>Imunisasi :</b> ";
				if(!empty($data_im)) {
					$pem .= "<ol>";
					for($j=0;$j<sizeof($data_im);$j++) {
						$pem .= "<li>" . $data_im[$j][imunisasi_nama] . "</li>";
					}
					$pem .= "</ol>";
				} else $pem .= "-";
			$pem .= "</li>";
			*/
			$pem .= "</ul>";
			$table->addRow(
				($no+$i), 
				$data[$i][kunjungan_ke] . "<hr />" . tanggalIndo($data[$i][tgl_periksa], 'j M Y'),
				$pem
				);
			/*
			$table->addOnclickTd(
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_tab_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')"
			);
			*/
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$objResponse->addAssign("modal_list_kunjungan", "style.display", "");
		$objResponse->addAssign("tab_list_semua_kunjungan_navi", "innerHTML", $navi);
		$objResponse->addAssign("mlk_no_rm", "innerHTML", $data[0][no_rm]);
		$objResponse->addAssign("mlk_nama", "innerHTML", $data[0][nama]);
		$objResponse->addAssign("mlk_sex", "innerHTML", $data[0][sex]);
		$objResponse->addAssign("tab_list_semua_kunjungan", "innerHTML", $ret);
		$objResponse->addScriptCall("disable_mainbar", "#E5E6E1");
		return $objResponse;
	}
Esempio n. 28
0
	function list_data($hal=0, $val="") {
		if($val[pelayanan_id]) $s .= " AND pel.id = '" .$val[pelayanan_id]. "'";
		$tgl_periksa_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
		$tgl_periksa_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
		//$tgl_periksa_dari = $val[tgl_mulai_bln] . "/" . $val[tgl_mulai_tgl] . "/" . $val[tgl_mulai_thn];
		//$tgl_periksa_sampai = $val[tgl_selesai_bln] . "/" . $val[tgl_selesai_tgl] . "/" . $val[tgl_selesai_thn];
        $paging = new MyPagina;
		$paging->setOnclickValue("xajax.getFormValues('form_kunjungan')");
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				k.kunjungan_ke as kunjungan_ke,
				kk.no_antrian as no_antrian,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				p.nama as nama,
				pel.nama as pelayanan,
				kk.tgl_daftar as tgl_daftar,
				kk.tgl_periksa as tgl_periksa,
				kk.tgl_keluar as tgl_keluar
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)

			WHERE
				DATE(kk.tgl_periksa) BETWEEN '".$tgl_periksa_dari."' AND '".$tgl_periksa_sampai."'
				AND pel.jenis = 'RAWAT JALAN'
				$s
			ORDER BY 
				k.id DESC, kk.id ASC
		";
       
       
		$paging->sql = $sql;
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 300;
		$table->addTh(
			"No", 
			"No.<br />Kjg",
			"No. RM", 
			"Pasien", 
			"Poliklinik", 
			"Tgl<br />Daftar",
			"Tgl<br />Keluar",
			"Hapus"
		);
		$table->addExtraTh("style=\"width:50px;\"","style=\"width:50px;\"","style=\"width:80px;\"","style=\"width:400px;\"","","","","style=\"width:70px;\"");
		for($i=0;$i<sizeof($data);$i++) {
			$table->addRow(
				($no+$i), 
				$data[$i][id_kunjungan], 
				$data[$i][no_rm], 
				$data[$i][nama], 
				$data[$i][pelayanan], 
				tanggalIndo($data[$i][tgl_daftar], 'j M Y') . "<br />" . tanggalIndo($data[$i][tgl_daftar], 'H:i'), 
				tanggalIndo($data[$i][tgl_keluar], 'j M Y') . "<br />" . tanggalIndo($data[$i][tgl_keluar], 'H:i'), 
				"<a href=\"javascript:void(0)\" title=\"Hapus Kunjungan\" onclick=\"hapus_kunjungan_kamar('".$data[$i][id_kunjungan]."','".$data[$i][id_kunjungan_kamar]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus Kunjungan\" border=\"0\" /></a>");
			$table->addOnclickTd(
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')",
				"xajax_buka_kunjungan('".$data[$i][id_kunjungan_kamar]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}
	function list_pasien($hal, $id_pekerjaan, $val) {
		unset($_SESSION[rekmed][statistik_pasien_semua_pekerjaan][list_pasien]);
		/*cek tanggal untuk menghindari 2007-02-31=>mundur 1 hari atw 1 bulan*/
		$val[tgl_periksa_tgl_start] = empty($val[tgl_periksa_tgl_start])?"1":$val[tgl_periksa_tgl_start];
		$val[tgl_periksa_bln_start] = empty($val[tgl_periksa_bln_start])?"1":$val[tgl_periksa_bln_start];

		$val[tgl_periksa_tgl_end] = empty($val[tgl_periksa_tgl_end])?"1":$val[tgl_periksa_tgl_end];
		$val[tgl_periksa_bln_end] = empty($val[tgl_periksa_bln_end])?"1":$val[tgl_periksa_bln_end];

		$tgl_start = @date("Y-m-d", @mktime(1,1,1,$val[tgl_periksa_bln_start], $val[tgl_periksa_tgl_start], $val[tgl_periksa_thn_start]));
		$tgl_end = @date("Y-m-d", @mktime(1,1,1,$val[tgl_periksa_bln_end], $val[tgl_periksa_tgl_end], $val[tgl_periksa_thn_end]));

		if($val[jangka_waktu] == "hari") {
			$tanggal_awal = tanggalIndo($tgl_start, "j F Y");
			$tanggal_akhir = tanggalIndo($tgl_end, "j F Y");
			$_q = "AND DATE(p.tgl_daftar) BETWEEN '" . $tgl_start . "' AND '" . $tgl_end . "'";
		} elseif($val[jangka_waktu] == "bulan") {
			$tanggal_awal = tanggalIndo($tgl_start, "F Y");
			$tanggal_akhir = tanggalIndo($tgl_end, "F Y");
			$_q = "AND EXTRACT(YEAR_MONTH FROM p.tgl_daftar) BETWEEN '" . $val[tgl_periksa_thn_start] . $val[tgl_periksa_bln_start] . "' AND '" . $val[tgl_periksa_thn_end] . $val[tgl_periksa_bln_end] . "'";
		} else {
			$tanggal_awal = tanggalIndo($tgl_start, "Y");
			$tanggal_akhir = tanggalIndo($tgl_end, "Y");
			$_q = "AND YEAR(p.tgl_daftar) BETWEEN '" . $val[tgl_periksa_thn_start] . "' AND '" . $val[tgl_periksa_thn_end] . "'";
		}

		$objResponse = new xajaxResponse();
		$paging = new MyPagina;
		$paging->rows_on_page = 5;
		$paging->hal = $hal;
		$sql = "
			SELECT
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as id_display,
				p.nama as nama,
				p.tgl_lahir as tgl_lahir,
				CONCAT(p.alamat, ' ', IF(p.rt = '','',CONCAT(' RT ', p.rt)), IF(p.rw = '','',CONCAT(' RW ', p.rw)), ', ', des.nama, ', ', kec.nama, ', ', kab.nama) as alamat,
				p.tgl_daftar as tgl_daftar,
				p.sex as jk,
				rp.nama as nama_pekerjaan
			FROM
				pasien p
				JOIN ref_desa des ON (des.id = p.desa_id)
				JOIN ref_kecamatan kec ON (kec.id = des.kecamatan_id)
				JOIN ref_kabupaten kab ON (kab.id = kec.kabupaten_id)
				JOIN ref_propinsi prop ON (prop.id = kab.propinsi_id)
				JOIN ref_pekerjaan rp ON (rp.id = p.pekerjaan_id)
			WHERE
				rp.id = '".$id_pekerjaan."'
				$_q
			GROUP BY p.id
			ORDER BY
				p.tgl_daftar
		";
		
		//echo $sql;
		//$objResponse->addAssign("debug", "innerHTML", $sql);
		$paging->onclick_func = "xajax_list_pasien";
		$paging->setOnclickValue($id_pekerjaan, "xajax.getFormValues('statistik_pasien_semua_pekerjaan')");

		$paging->sql = $sql;
		$paging->get_page_result();
		$ket_hal = $paging->ket_hal_ini();
		$no = $paging->start_number();
		$data = $paging->data;
		$navi = $paging->navi();
		$is_last_page = $paging->is_last_page();

		$title = "Daftar Pasien Pasien Dengan Pekerjaan ".$data[0][nama_pekerjaan]. "\nPeriode " . $tanggal_awal . " s.d. " . $tanggal_akhir;
		$objResponse->addClear("list_pasien", "style.display");
		$atas = "<div style=\"text-align:right;width:100%;\">";
		$atas .= "<img src=\"". IMAGES_URL . "printer.gif\" alt=\"Cetak\" onclick=\"cetak('".URL."rekmed/statistik_pasien_semua_pekerjaan_list_pasien_cetak/?hal=".$hal."');\" class=\"printer_button\" />";
		$atas .= "<img src=\"". IMAGES_URL . "close.gif\" alt=\"Tutup\" onclick=\"tutup_list_pasien();\" class=\"close_button2\" />";
		$atas .= "</div>";
		$atas .= "<h3>".nl2br($title)."</h3>";
		$atas .= "<div class=\"navi\">" . $navi . "</div>";
		$atas .= "<hr />";
		for($i=0;$i<sizeof($data);$i++) {
			$arr_usia = hitungUmur($data[$i][tgl_lahir], $data[$i][tgl_daftar]);
			$usia = empty($arr_usia[tahun])?"":$arr_usia[tahun] . " thn ";
			$usia .= empty($arr_usia[bulan])?"":$arr_usia[bulan] . " bln ";
			$usia .= empty($arr_usia[hari])?"":$arr_usia[hari] . " hr ";
			$ret .= "<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\">";
			$ret .= "<tr><td style=\"width:30px;vertical-align:top;\" rowspan=\"6\">".($no+$i).".</td><td style=\"width:150px\">No. RM</td><td>" . $data[$i][id_display] . "</td></tr>";
			$ret .= "<tr><td>Nama</td><td>" . $data[$i][nama] . "</td></tr>";
			$ret .= "<tr><td>Usia</td><td>" . (empty($usia)?"-":$usia) . "</td></tr>";
			$ret .= "<tr><td>Jenis Kelamin</td><td>" . $data[$i][jk] . "</td></tr>";
			$ret .= "<tr><td style=\"vertical-align:top;\">Alamat</td><td>" . $data[$i][alamat] . "</td></tr>";
			$ret .= "<tr><td>Tgl Daftar</td><td>" . tanggalIndo($data[$i][tgl_daftar], "j F Y") . "</td></tr>";
			$ret .= "</table>";
			$ret .= "<hr />";
		}
		$_SESSION[rekmed][statistik_pasien_semua_pekerjaan][list_pasien][is_last_page] = $is_last_page;
		$_SESSION[rekmed][statistik_pasien_semua_pekerjaan][list_pasien][title] = $title;
		$_SESSION[rekmed][statistik_pasien_semua_pekerjaan][list_pasien][content] = $ret;
		$_SESSION[rekmed][statistik_pasien_semua_pekerjaan][list_pasien][ket_hal] = $ket_hal;
		$objResponse->addAssign("list_pasien", "innerHTML", $atas.$ret);
		return $objResponse;
	}
Esempio n. 30
0
	function list_data($hal=0, $val="") {
		if($val[cara_bayar]) $q = " AND kk.cara_bayar = '".$val[cara_bayar]."' ";
		if($val[pasien_id]) {
			$q .= " AND p.id = '".$val[pasien_id]."' ";
		} elseif($val[nama]) {
			$q .= " AND p.nama LIKE '%".$val[nama]."%' ";
		} elseif($val[kwitansi_id]) {
			$q .= " AND kw.id = '".$val[kwitansi_id]."' ";
		} else {
			$tgl_daftar_dari = $val[tgl_mulai_thn] . "-" . $val[tgl_mulai_bln] . "-" . $val[tgl_mulai_tgl];
			$tgl_daftar_sampai = $val[tgl_selesai_thn] . "-" . $val[tgl_selesai_bln] . "-" . $val[tgl_selesai_tgl];
			$q .= " AND DATE(kk.tgl_keluar) BETWEEN '".$tgl_daftar_dari."' AND '".$tgl_daftar_sampai."' ";
		}
		if(!$val[semua]) $q .= " AND kw.status = 'ANGSUR' ";
		$paging = new MyPagina;
		$paging->setOnclickValue("xajax.getFormValues('form_kunjungan')");
		$sql = "
			SELECT 
				k.id as id_kunjungan,
				kk.id as id_kunjungan_kamar,
				CONCAT_WS('-', SUBSTRING(p.id, 1,2), SUBSTRING(p.id, 3,2), SUBSTRING(p.id, 5,2), SUBSTRING(p.id, 7,2)) as no_rm,
				p.id as pasien_id,
				REPLACE((p.nama), ('".$val[nama]."'), ('<b>".$val[nama]."</b>')) as nama,
				kk.cara_bayar as cara_bayar,
				CONCAT(p.alamat, ' ', 'RT ', p.rt, '/ RW ', p.rw, '<br />',des.nama, ', ', kec.nama, ', ', kab.nama, '<br />', prop.nama) as alamat,
				CONCAT_WS('-', kw.tempat_pembayaran, kw.id) as no_kwitansi,
				kw.id as kwitansi_id,
				kw.bayar as bayar,
				SUM(kb.bayar_bhp+kb.bayar_jasa)-kw.bayar as kurang,
				kw.tgl as tgl
			FROM 
				kunjungan k
				JOIN pasien p ON (p.id = k.pasien_id)
				JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
				JOIN kamar kmr ON (kmr.id = kk.kamar_id)
				JOIN pelayanan pel ON (pel.id = kmr.pelayanan_id)
				JOIN kunjungan_bayar kb ON (kb.kunjungan_kamar_id = kk.id)
				JOIN kwitansi_detil kwd ON (kwd.kunjungan_bayar_id = kb.id)
				JOIN kwitansi kw ON (kw.id = kwd.kwitansi_id)
				JOIN ref_desa des ON (des.id = p.desa_id)
				JOIN ref_kecamatan kec ON (kec.id = des.kecamatan_id)
				JOIN ref_kabupaten kab ON (kab.id = kec.kabupaten_id)
				JOIN ref_propinsi prop ON (prop.id = kab.propinsi_id)
			WHERE
				1=1
				$q
			GROUP BY
				kw.id
			ORDER BY 
				kw.id
		";
		$paging->sql = $sql;
		$paging->rows_on_page = 20;
		$paging->hal = $hal;
		$paging->get_page_result();

		$_SESSION[keuangan_kunjungan][hal] = $hal;

		$data = $paging->data;
		$no = $paging->start_number();
		$navi = $paging->navi();

		$table = new Table;
		$table->tbody_height = 310;
		$table->addTh(
			"No", 
			"No. RM", 
			"Nama Pasien", 
			"Alamat", 
			"Cara Bayar", 
			"Nomor Kwitansi", 
			"Bayar",
			"Kurang"
		);
		$table->addExtraTh("style=\"width:20px;\"","style=\"width:100px;\"","","","","","","");
		for($i=0;$i<sizeof($data);$i++) {
			//if(!empty($baru[$i][kamar])) $kamar = implode("<br />", $baru[$i][kamar]);
			//else $kamar = $baru[$i][kamar][0];
			$table->addRow(
				($no+$i), 
				$data[$i][no_rm], 
				$data[$i][nama], 
				$data[$i][alamat], 
				$data[$i][cara_bayar], 
				$data[$i][no_kwitansi],
				uangIndo($data[$i][bayar]),
				uangIndo($data[$i][kurang])
				);
			$table->addOnclickTd(
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')",
				"xajax_buka_langsung_bayar('".$data[$i][kwitansi_id]."')"
			);
		}
		$ret = $table->build();
		$objResponse = new xajaxResponse();
		//$objResponse->addAssign("debug", "innerHTML", $val[semua]);
		$objResponse->addAssign("navi", "innerHTML", $navi);
		$objResponse->addAssign("list_data", "innerHTML", $ret);
		return $objResponse;
	}