Skip to content

Commit

Permalink
#258: Tambah tampilan kartu rumah tangga dan laporan cetaknya, diambi…
Browse files Browse the repository at this point in the history
…l dari SID 3.10
  • Loading branch information
Eddie Ridwan committed Nov 2, 2017
1 parent 5c75eae commit 6e1d181
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 5 deletions.
2 changes: 1 addition & 1 deletion donjo-app/controllers/rtm.php
Expand Up @@ -279,7 +279,7 @@ function cetak_kk($id=0){
$data['kepala_kk'] = $kk;
$nav['act']= 3;
$header = $this->header_model->get_data();
$this->load->view("sid/kependudukan/cetak_kk", $data);
$this->load->view("sid/kependudukan/cetak_rtm", $data);

}

Expand Down
16 changes: 14 additions & 2 deletions donjo-app/models/rtm_model.php
Expand Up @@ -302,7 +302,7 @@ function get_kode_wilayah(){
}

function list_penduduk_lepas(){
$sql = "SELECT p.id,p.nik,p.nama,h.nama as kk_level FROM tweb_penduduk p LEFT JOIN tweb_penduduk_hubungan h ON p.kk_level=h.id WHERE (status = 1 OR status = 3) AND id_rtm = 0";
$sql = "SELECT p.id,p.nik,p.nama,h.nama as kk_level FROM tweb_penduduk p LEFT JOIN tweb_penduduk_hubungan h ON p.kk_level=h.id WHERE (status = 1 OR status = 3) AND status_dasar = 1 AND id_rtm = 0";
$query = $this->db->query($sql);
$data=$query->result_array();

Expand All @@ -317,7 +317,19 @@ function list_penduduk_lepas(){
}

function list_anggota($id=0){
$sql = "SELECT b.dusun,b.rw,b.rt,u.id,nik,dokumen_pasport,dokumen_kitas,x.nama as sex,u.rtm_level,tempatlahir,tanggallahir,a.nama as agama, d.nama as pendidikan,j.nama as pekerjaan,w.nama as status_kawin,f.nama as warganegara,nama_ayah,nama_ibu,g.nama as golongan_darah,u.nama,status,h.nama AS hubungan FROM tweb_penduduk u LEFT JOIN tweb_penduduk_agama a ON u.agama_id = a.id LEFT JOIN tweb_penduduk_pekerjaan j ON u.pekerjaan_id = j.id LEFT JOIN tweb_penduduk_pendidikan_kk d ON u.pendidikan_kk_id = d.id LEFT JOIN tweb_penduduk_warganegara f ON u.warganegara_id = f.id LEFT JOIN tweb_golongan_darah g ON u.golongan_darah_id = g.id LEFT JOIN tweb_penduduk_kawin w ON u.status_kawin = w.id LEFT JOIN tweb_penduduk_sex x ON u.sex = x.id LEFT JOIN tweb_rtm_hubungan h ON u.rtm_level = h.id LEFT JOIN tweb_wil_clusterdesa b ON u.id_cluster = b.id WHERE id_rtm = ? ORDER BY rtm_level";
$sql = "SELECT b.dusun,b.rw,b.rt,u.id,nik,x.nama as sex,k.no_kk,u.rtm_level,tempatlahir,tanggallahir,a.nama as agama, d.nama as pendidikan,j.nama as pekerjaan,w.nama as status_kawin,f.nama as warganegara,nama_ayah,nama_ibu,g.nama as golongan_darah,u.nama,status,h.nama AS hubungan
FROM tweb_penduduk u
LEFT JOIN tweb_keluarga k ON u.id_kk = k.id
LEFT JOIN tweb_penduduk_agama a ON u.agama_id = a.id
LEFT JOIN tweb_penduduk_pekerjaan j ON u.pekerjaan_id = j.id
LEFT JOIN tweb_penduduk_pendidikan_kk d ON u.pendidikan_kk_id = d.id
LEFT JOIN tweb_penduduk_warganegara f ON u.warganegara_id = f.id
LEFT JOIN tweb_golongan_darah g ON u.golongan_darah_id = g.id
LEFT JOIN tweb_penduduk_kawin w ON u.status_kawin = w.id
LEFT JOIN tweb_penduduk_sex x ON u.sex = x.id
LEFT JOIN tweb_rtm_hubungan h ON u.rtm_level = h.id
LEFT JOIN tweb_wil_clusterdesa b ON u.id_cluster = b.id
WHERE id_rtm = ? ORDER BY rtm_level";

$query = $this->db->query($sql,array($id));
$data=$query->result_array();
Expand Down
129 changes: 129 additions & 0 deletions donjo-app/views/sid/kependudukan/cetak_rtm.php
@@ -0,0 +1,129 @@
<?php $this->load->view('print/headjs.php');?>
<body>
<div id="container">
<link href="<?php echo base_url()?>assets/css/report.css" rel="stylesheet" type="text/css">
<!-- Print Body -->
<div id="body">
<div align="center">
<h3>KARTU RUMAH TANGGA</h3>
<h4>SALINAN</h4>
<h5>No. <?php echo $kepala_kk['no_kk']?> </h4>
</div>
<br>
<table width="100%" cellpadding="3" cellspacing="4">
<tr>
<td width="100">Nama KK</td>
<td width="600">: <?php echo strtoupper($kepala_kk['nama']) ?></td>
<td width="160">Kecamatan</td>
<td width="150">: <?php echo strtoupper($desa['nama_kecamatan']) ?></td>
</tr>
<tr>
<td>Alamat</td>
<td>: <?php echo strtoupper($kepala_kk['dusun']) ?> </td>
<td>Kabupaten/Kota</td>
<td>: <?php echo $desa['nama_kabupaten'] ?></td>
</tr>
<tr>
<td>RT / RW</td>
<td>: <?php echo $kepala_kk['rt'] ?> / <?php echo $kepala_kk['rw'] ?></td>
<td>Kode Pos</td>
<td>: <?php echo strtoupper($desa['kode_pos']) ?></td>
</tr>
<tr>
<td>Kelurahan/Desa</td>
<td>: <?php echo strtoupper($desa['nama_desa']) ?></td>
<td>Provinsi</td>
<td>: <?php echo strtoupper($desa['nama_propinsi']) ?></td>
</tr>
</table>
<br>
<table class="border thick ">
<thead>
<tr class="border thick">
<th width="7">No</th>
<th width='180'>Nama</th>
<th width='100'>NIK</th>
<th width='100'>NOMOR KK</th>
<th width='100'>Jenis Kelamin</th>
<th width='100'>Tempat Lahir</th>
<th width='120'>Tanggal Lahir</th>
<th width='100'>Agama</th>
<th width='100'>Pendidikan</th>
<th width='100'>Pekerjaan</th>
</tr>
</thead>
<tbody>
<?php foreach($main as $data): ?>
<tr class="data">
<td align="center" width="2"><?php echo $data['no']?></td>
<td><?php echo strtoupper($data['nama'])?></td>
<td><?php echo $data['nik']?></td>
<td><?php echo $data['no_kk']?></td>
<td><?php echo $data['sex']?></td>
<td><?php echo $data['tempatlahir']?></td>
<td><?php echo $data['tanggallahir']?></td>
<td><?php echo $data['agama']?></td>
<td><?php echo $data['pendidikan']?></td>
<td><?php echo $data['pekerjaan']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<br>
<table class="border thick ">
<thead>
<tr class="border thick">
<th width="7">No</th>
<th width='150'>Status Perkawinan</th>
<th width='240'>Status Hubungan dalam Keluarga</th>
<th width='140'>Kewarganegaraan</th>
<th width='170'>Nama Ayah</th>
<th width='170'>Nama Ibu</th>
<th width='70'>Golongan darah</th>
</tr>
</thead>
<tbody>
<?php foreach($main as $data): ?>
<tr class="data">
<td align="center" width="2"><?php echo $data['no']?></td>
<td><?php echo $data['status_kawin']?></td>
<td><?php echo $data['hubungan']?></td>
<td><?php echo $data['warganegara']?></td>
<td><?php echo strtoupper($data['nama_ayah'])?></td>
<td><?php echo strtoupper($data['nama_ibu'])?></td>
<td align="center"><?php echo $data['golongan_darah']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<br>
<table width="100%" cellpadding="3" cellspacing="4">
<tr>
<td width="25%"></td>
<td width="50%"></td>
<td width="25%" align="center"><?php echo $desa['nama_desa'] ?>, <?php echo tgl_indo(date("Y m d"))?></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td width="25%" align="center">KEPALA KELUARGA</td>
<td width="50%"></td>
<td align="center" width="150">KEPALA DESA <?php echo strtoupper($desa['nama_desa']) ?></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td width="25%" align="center"><?php echo strtoupper($kepala_kk['nama'])?></td>
<td width="50%"></td>
<td width="25%" align="center" width="150"><?php echo strtoupper($desa['nama_kepala_desa']) ?></td>
</tr>
</table>
</div>
<label>Tanggal cetak : &nbsp; </label><?php echo tgl_indo(date("Y m d"))?>
</div>
<div id="aside">
</div>
</div>
</body>
</html>
176 changes: 176 additions & 0 deletions donjo-app/views/sid/kependudukan/kartu_rtm.php
@@ -0,0 +1,176 @@
<script>
$(function(){
var nik = {};
nik.results = [
<?php foreach($penduduk as $data){?>
{id:'<?php echo $data['id']?>',name:"<?php echo $data['nik']." - ".($data['nama'])?>",info:"<?php echo ($data['alamat'])?>"},
<?php }?>
];
nik.total = nik.results.length;
$('#nik').flexbox(nik, {
resultTemplate: '<div><label>No nik : </label>{name}</div><div>{info}</div>',
watermark: 'Ketik nama / nik di sini..',
width: 260,
noResultsText :'Tidak ada nama / nik yang sesuai..',
onSelect: function() {
$('#'+'main').submit();
}
});
});
</script>
<div id="pageC">
<table class="inner">
<tr style="vertical-align:top">
<td style="background:#fff;padding:0px;">
<div class="content-header">
<h3>Form Manajemen KK : <?php echo $kepala_kk['nama']?></h3>
</div>
<div id="contentpane">
<form id="mainform" name="mainform" action="<?php echo $form_action?>" method="post" enctype="multipart/form-data">
<div class="ui-layout-north panel">
<div class="left">
<div class="uibutton-group">
<a href="<?php echo site_url("rtm/anggota/$p/$o/$id_kk")?>" class="uibutton icon prev">Daftar Anggota</a>
</div>
</div>
</div>
<div class="ui-layout-center" id="maincontent" style="padding: 5px;">
<table width="100%" cellpadding="3" cellspacing="4">
<div align="center">
<h3> KARTU RUMAH TANGGA </h3>
<h4>No. <?php echo unpenetration($kepala_kk['no_kk'])?> </h4>
</div>
<tr>
<td width="100">Alamat</td>
<td width="200">: <?php echo strtoupper(unpenetration(ununderscore($kepala_kk['dusun']))) ?></td>
<td width="120">Kabupaten</td>
<td width="150">: <?php echo strtoupper(unpenetration($desa['nama_kabupaten'])) ?></td>
</tr>
<tr>
<td>RT/RW</td>
<td>: <?php echo unpenetration($kepala_kk['rt']) ?> / <?php echo unpenetration($kepala_kk['rw']) ?> </td>
<td>Kode Pos</td>
<td>: <?php echo $desa['kode_pos'] ?></td>
</tr>
<tr>
<td>Kelurahan/Desa</td>
<td>: <?php echo strtoupper(unpenetration($desa['nama_desa'])) ?></td>
<td>Propinsi</td>
<td>: <?php echo strtoupper(unpenetration($desa['nama_propinsi'])) ?></td>
</tr>
<tr>
<td>Kecamatan</td>
<td>: <?php echo strtoupper(unpenetration($desa['nama_kecamatan'])) ?></td>
<td>Jumlah Anggota Rumah Tangga</td>
<td>: <?php echo count($main)?></td>
</tr>
</table>
<p style="font-family:verdana,arial,sans-serif;font-size:10px;"></p>
<table class="list" style="width:100%">
<thead>
<tr>
<th>No</th>
<th align="left" width='180'>Nama</th>
<th align="left">NIK</th>
<th align="left">NOMOR KK</th>
<th align="left" width='100'>Jenis Kelamin</th>
<th align="left" width='100'>Tempat Lahir</th>
<th align="left" width='80'>Tanggal Lahir</th>
<th align="left" width='100'>Agama</th>
<th align="left" width='100'>Pendidikan</th>
<th align="left" width='100'>Pekerjaan</th>
</tr>
</thead>
<tbody>
<?php foreach($main as $data): ?>
<tr>
<td align="center" width="2"><?php echo $data['no']?></td>
<td><?php echo strtoupper(unpenetration($data['nama']))?></td>
<td><?php echo $data['nik']?></td>
<td><?php echo $data['no_kk']?></td>
<td><?php echo $data['sex']?></td>
<td><?php echo $data['tempatlahir']?></td>
<td><?php echo $data['tanggallahir']?></td>
<td><?php echo $data['agama']?></td>
<td><?php echo $data['pendidikan']?></td>
<td><?php echo $data['pekerjaan']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="list" style="width:100%">
<thead>
<tr>
<th>No</th>
<th align="left" width='100'>Status Perkawinan</th>
<th align="left" width='130'>Status Hubungan dalam Keluarga</th>
<th align="left" width='100'>Kewarganegaraan</th>
<th align="left" width='100'>Nama Ayah</th>
<th align="left" width='100'>Nama Ibu</th>
<th align="left" width='100'>Golongan darah</th>
</tr>
</thead>
<tbody>
<?php foreach($main as $data): ?>
<tr>
<td align="center" width="2"><?php echo $data['no']?></td>
<td><?php echo $data['status_kawin']?></td>
<td><?php echo $data['hubungan']?></td>
<td><?php echo $data['warganegara']?></td>
<td><?php echo strtoupper($data['nama_ayah'])?></td>
<td><?php echo strtoupper($data['nama_ibu'])?></td>
<td><?php echo $data['golongan_darah']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table width="100%" cellpadding="3" cellspacing="4">
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td width="100"></td>
<td width="400"></td>
<td align="center" width="150"><?php echo unpenetration($desa['nama_desa']) ?>, <?php echo tgl_indo(date("Y m d"))?></td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</table>
<p style="font-family:verdana,arial,sans-serif;font-size:10px;"></p>
</div>
<div class="ui-layout-south panel bottom">
<div class="left">
<a href="<?php echo site_url()?>rtm" class="uibutton icon prev">Kembali</a>
</div>
<div class="right">
<div class="uibutton-group">
<a href="<?php echo site_url("rtm/cetak_kk/$id_kk")?>" target="_blank" class="uibutton special">Cetak</a>
</div>
</div>
</div>
</form>
</div>
</td></tr>
</table>
</div>
8 changes: 6 additions & 2 deletions donjo-app/views/sid/kependudukan/rtm_anggota.php
Expand Up @@ -10,7 +10,7 @@
<h3>Daftar Anggota Rumah Tangga : <?php echo $kepala_kk['nama']?> - <?php echo $kepala_kk['no_kk']?></h3>
<div class="left">
<div class="uibutton-group">
<a href="<?php echo site_url("rtm/ajax_add_anggota/$p/$o/$kk")?>" class="uibutton tipsy south" title="Tambah Data" header="Tambah Anggota rtm" target="ajax-modalx" rel="window"><span class="fa fa-plus">&nbsp;</span>Tambah Anggota</a>
<a href="<?php echo site_url("rtm/ajax_add_anggota/$p/$o/$kk")?>" class="uibutton tipsy south" title="Tambah Data" header="Tambah Anggota Rumah Tangga" target="ajax-modalx" rel="window"><span class="fa fa-plus">&nbsp;</span>Tambah Anggota</a>
<button type="button" title="Hapus Data" onclick="deleteAllBox('mainform','<?php echo site_url("rtm/delete_all_anggota/$p/$o/$kk")?>')" class="uibutton tipsy south"><span class="fa fa-trash">&nbsp;</span>Hapus Data</button>
<?php /*<a href="<?php echo site_url("rtm/lepas_anggota/$p/$o/$kk")?>" type="button" title="Lepas KK" class="uibutton tipsy south" target="ajax-modal" rel="window" header="Lepas KK"><span class="ui-icon ui-icon-next">&nbsp;</span>Lepas KK</a>*/?>
</div>
Expand All @@ -30,7 +30,9 @@
<th><input type="checkbox" class="checkall"/></th>
<th width="80">Aksi</th>
<th width='100'>NIK</th>
<th width='100'>Nomor KK</th>
<th>Nama</th>
<th width='50'>Jenis Kelamin</th>
<th width="150">Hubungan</th>
<th>Alamat</th>

Expand All @@ -50,8 +52,10 @@
</div>
</td>
<td><label><?php echo $data['nik']?></label></td>
<td><label><?php echo $data['no_kk']?></label></td>
<td><label><?php echo strtoupper(unpenetration($data['nama']))?></label></td>

<td><?php echo $data['sex']?></td>
<td><?php echo $data['hubungan']?></td>
<td><?php echo unpenetration($data['alamat'])?></td>
</tr>
Expand All @@ -65,7 +69,7 @@
<a href="<?php echo site_url("rtm/index/$p/$o")?>" class="uibutton icon prev">Kembali</a>
</div>
<div class="right">
<a href="<?php echo site_url("rtm/kartu_rtm/$p/$o/$kk")?>" class="uibutton confirm icon next">Kartu rtm</a>
<a href="<?php echo site_url("rtm/kartu_rtm/$p/$o/$kk")?>" class="uibutton confirm icon next">Kartu Rumah Tangga</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 6e1d181

Please sign in to comment.