Esempio n. 1
0
 function lookup_uu()
 {
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $table = "tb_peraturan_pembentukan_daerah";
     $data_type = $this->adodbx->GetDataType($table);
     foreach ($data_type as $x => $val) {
         if ($val == "C" || $val == "X") {
             $data["text"][] = $x;
         }
     }
     $col_text = cek_var($data["text"]) ? $data["text"] : "";
     $field = join(",", $col_text);
     //$field="jenis_pelanggaran";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     //$table=$this->model->tbl;
     $totalRows = count($this->adodbx->search_record_where($table, $whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sort = $this->input->get_post("sort") ? $this->input->get_post("sort") : "idx";
     if (!empty($sort)) {
         $sortBy = " order by {$sort}";
     }
     $arrData = $this->adodbx->search_record_by_limit_where($table, $whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "lookup_uu";
     $config['per_page'] = $perPage;
     $config['total_rows'] = $totalRows;
     $config['uri_segment'] = $uriSegment;
     $config["suffix"] = $queryString;
     $config["first_url"] = $config["base_url"] . $queryString;
     //$config['display_pages'] = FALSE;
     $this->pagination->initialize($config);
     $data["arrData"] = $arrData;
     $this->load->view($this->module . "v_lookup_uu", $data);
 }
Esempio n. 2
0
 function data_rkp_segmen()
 {
     $sql_rkp = "select 'propinsi' as batas_wilayah,1 as sort,\n\t\t\t\ta.tahun_peraturan as tahun,count(b.idx) as total \n\t\t\t\tfrom tb_batas_propinsi a,tb_batas_propinsi_detail b\n\t\t\t\twhere a.idx=b.id_parent and tahun_peraturan>=2004\n\t\t\t\tgroup by a.tahun_peraturan\n\t\t\t\t\n\t\t\t\tunion all\n\t\t\t\t\n\t\t\t\tselect 'propinsi_old' as batas_wilayah,2 as sort,\n\t\t\t\ta.tahun_peraturan as tahun,count(b.idx) as total \n\t\t\t\tfrom tb_batas_propinsi a,tb_batas_propinsi_detail b\n\t\t\t\twhere a.idx=b.id_parent and tahun_peraturan<2004\n\t\t\t\t\n\t\t\t\tunion all\n\t\t\t\t\n\t\t\t\tselect 'kab_kota' as batas_wilayah,3 as sort,\n\t\t\t\ta.tahun_peraturan as tahun,count(b.idx) as total \n\t\t\t\tfrom tb_batas_kabupaten a,tb_batas_kabupaten_detail b\n\t\t\t\twhere a.idx=b.id_parent and tahun_peraturan>=2004\n\t\t\t\tgroup by a.tahun_peraturan\n\t\t\t\t\n\t\t\t\tunion all \n\t\t\t\t\n\t\t\t\tselect 'kab_kota_old' as batas_wilayah,4 as sort,\n\t\t\t\ta.tahun_peraturan as tahun,count(b.idx) as total \n\t\t\t\tfrom tb_batas_kabupaten a,tb_batas_kabupaten_detail b\n\t\t\t\twhere a.idx=b.id_parent and tahun_peraturan<2004\n\t\t\t\t\n\t\t\t\t";
     $sql_group = "select sort,batas_wilayah,group_concat(tahun,':',total order by tahun asc separator ',') as data from (" . $sql_rkp . ") a \n\t\t\t\t\tgroup by sort,batas_wilayah order by sort";
     $arrData = $this->conn->GetAll($sql_group);
     if (cek_array($arrData)) {
         foreach ($arrData as $x => $val) {
             $data_tmp = array();
             $data_tmp["batas_wilayah"] = strtoupper($val["batas_wilayah"]);
             $data_tmp_data = $this->parse_data($val["data"]);
             $data_all[$val["batas_wilayah"]] = $data_tmp_data;
             $arrData[$x]["data_per_tahun"] = $data_tmp_data;
             /* merge to $data_tmp */
             $data_tmp += $data_tmp_data;
             $arrDataPivot[] = $data_tmp;
         }
     }
     //$data[]=array("Tahun","Batas Propinsi","Batas Kabupaten");
     for ($i = date('Y'); $i >= 2004; $i--) {
         $prop = cek_var($data_all["propinsi"][$i]) ? (int) $data_all["propinsi"][$i] : 0;
         $kab = cek_var($data_all["kab_kota"][$i]) ? (int) $data_all["kab_kota"][$i] : 0;
         $data[] = array((string) $i, $prop, $kab);
     }
     $prop = cek_var($data_all["propinsi_old"][0]) ? (int) $data_all["propinsi_old"][0] : 0;
     $kab = cek_var($data_all["kab_kota_old"][0]) ? (int) $data_all["kab_kota_old"][0] : 0;
     $data[] = array("1945-2003", $prop, $kab);
     $this->jumlah_segmen_propinsi = array_sum($data_all["propinsi"]) + array_sum($data_all["propinsi_old"]);
     $this->jumlah_segmen_kabupaten = array_sum($data_all["kab_kota"]) + array_sum($data_all["kab_kota_old"]);
     return $data;
 }
Esempio n. 3
0
 function daftar_penetapan_prop()
 {
     $arrBread = array(array("title" => "Daftar Penetapan Batas Propinsi", "url" => "" . $this->module . "/daftar_penetapan_prop/", "active" => "", "icon" => " "));
     $this->set_bread($arrBread);
     $sql = "select a.*,concat(propinsi_1,':',propinsi_2) as propinsi,\n\t\t\t\tconcat(id_propinsi_1,':',id_propinsi_2) as id_propinsi,\n\t\t\t\tb.kabupaten\n\t\t\t\t from tb_batas_propinsi a \n\t\t\t\tleft join\n\t\t\t\t(select id_parent,group_concat(concat(kabupaten_1,':',kabupaten_2) separator ','\n\t\t\t\t) as kabupaten from tb_batas_propinsi_detail  group by id_parent\n\t\t\t\t) b on a.idx=b.id_parent";
     $data_type = $this->adodbx->GetDataType("({$sql}) a");
     foreach ($data_type as $x => $val) {
         if ($val == "C" || ($val = "X")) {
             $data["text"][] = $x;
         }
     }
     $col_text = $data["text"];
     $field = join(",", $col_text);
     //$field="jenis_pelanggaran";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     if (cek_var($this->input->get_post("id_propinsi"))) {
         $where[] = "id_propinsi like '%" . $this->input->get_post("id_propinsi") . "%'";
     }
     if (cek_var($this->input->get_post("tahun_peraturan"))) {
         $where[] = "tahun_peraturan='" . $this->input->get_post("tahun_peraturan") . "'";
     }
     if (cek_var($this->input->get_post("id_jenis_peraturan"))) {
         $where[] = "id_jenis_peraturan='" . $this->input->get_post("id_jenis_peraturan") . "'";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql = " where ";
         $whereSql .= join(" and ", $where);
     }
     $arrDataTahun = $this->conn->GetAll("select tahun_peraturan from tb_batas_propinsi group by tahun_peraturan order by tahun_peraturan desc");
     if (cek_array($arrDataTahun)) {
         foreach ($arrDataTahun as $x => $val) {
             $dataTahun["" . $val["tahun_peraturan"] . ""] = $val["tahun_peraturan"];
         }
     }
     $arrData = $this->conn->GetAll("select * from ({$sql}) a " . $whereSql);
     $arrDataDetail = $this->conn->GetAll("select * from tb_batas_propinsi_detail");
     foreach ($arrDataDetail as $x => $val) {
         $data_detail[$val["id_parent"]][] = $val;
     }
     foreach ($arrData as $x => $val) {
         $data_detail_parent = array();
         $data_detail_parent = cek_var($data_detail[$val["idx"]]) ? $data_detail[$val["idx"]] : array();
         $arrData[$x]["data_detail"] = $data_detail_parent;
     }
     $data["arrData"] = $arrData;
     $data["arrDataTahun"] = $dataTahun;
     $this->_render_page($this->module . "daftar_penetapan_propinsi", $data, true);
 }
Esempio n. 4
0
                   </small>
                </h1>
                <!--
                <ol class="breadcrumb">
                   <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                   <li class="active">Blank page</li>
                </ol>-->
           </section>
           <?php 
}
?>

                <!-- Main content -->
                <section class="content">
                	<?php 
if (cek_var($this->layout_data["breadcrumb"])) {
    ?>
                    	<?php 
    echo $this->layout_data["breadcrumb"];
    ?>
					<?php 
}
?>
					<?php 
echo $content;
?>
				</section><!-- /.content -->
        </aside><!-- /.right-side -->
</div>
<!-- end: Wrapper-->
 function update_uu($id_parent)
 {
     $data = get_post();
     if (cek_var($data["dasar_id"])) {
         $data_id_arr = preg_split("/\\||\\,/", $data["dasar_id"]);
         if (cek_array($data_id_arr)) {
             $this->model_uu->DeleteData("id_parent={$id_parent}");
             foreach ($data_id_arr as $id_uu) {
                 $data_update = array();
                 $data_update["id_parent"] = $id_parent;
                 $data_update["id_peraturan"] = $id_uu;
                 $this->model_uu->InsertData($data_update);
             }
         }
     }
 }
Esempio n. 6
0
    ?>
    	<tr>
        	<td><?php 
    echo strtoupper($val["batas_wilayah"]);
    ?>
</td>
			<td class="tc"><?php 
    echo cek_var($val["data_lt_2003"]) ? $val["data_lt_2003"] : '-';
    ?>
</td>
			<?php 
    for ($i = 2004; $i <= max($tahun_max_arr); $i++) {
        ?>
            
            	<td class="tc"><?php 
        echo cek_var($val["data_per_tahun"][$i]) ? $val["data_per_tahun"][$i] : '-';
        ?>
</td>
			<?php 
    }
    ?>
        </tr>
        <?php 
}
?>
    </tbody>
</table>
</div></div> <!-- end:row-->
</div><!-- end: print_this -->

<script type="text/javascript" src="assets/js/lingkar/jquery.export2excel.js"></script>
Esempio n. 7
0
</li>
								<?php 
                }
                ?>
                                </ol>
                        <?php 
            }
            ?>
					<?php 
        }
        ?>
                    </td>
                    
                    <td>
                    	<?php 
        if (cek_var($dataUU[$val["idx"]])) {
            ?>
                        	 <?php 
            $data_uu = $dataUU[$val["idx"]]["data_uu"];
            $data_id = $dataUU[$val["idx"]]["id_uu"];
            $data_uu_arr = preg_split("/\\;/", str_replace("|", " Tentang ", $data_uu));
            ?>
                             <?php 
            if (cek_array($data_uu_arr)) {
                ?>
                             	<ol style="padding-left:1em">
								<?php 
                foreach ($data_uu_arr as $xx => $valx) {
                    ?>
                                	<li><?php 
                    echo $valx;