Exemplo n.º 1
0
 function module_list()
 {
     //if (!$this->cms->has_view($this->module)) redirect ($this->auth_error_page);
     //debug();
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $field = "module_name,module_path,module_url";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     //$this->model= new account_manager_model();
     $uriSegment = 4;
     $totalRows = count($this->model->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by order_num,idx";
     $arrData = $this->model->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "module_list";
     $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->_render_page($this->module . "module_list", $data, true);
 }
Exemplo n.º 2
0
 function user_list()
 {
     $queryString = rebuild_query_string();
     //debug();
     $q = $this->input->get_post("q");
     $field = "username,first_name,last_name,email";
     $whereSql = get_where_from_searchbox($field);
     $arrBread[] = array("text" => "" . $this->listText . "", "url" => "");
     $this->load->library('pagination');
     $perPage = 20;
     $uriSegment = 4;
     $totalRows = count($this->ammmodel->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by username";
     $arrData = $this->ammmodel->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     if (cek_array($arrData)) {
         foreach ($arrData as $x => $val) {
             $arrData[$x]["groups"] = (array) $this->ion_auth->get_users_groups($val["id"])->result_array();
         }
     }
     $config['base_url'] = $this->http_ref . "/index/";
     $config['per_page'] = $perPage;
     $config['total_rows'] = $totalRows;
     $config['uri_segment'] = $uriSegment;
     $config["suffix"] = $queryString;
     //$config['display_pages'] = FALSE;
     $this->pagination->initialize($config);
     $data["arrData"] = $arrData;
     $datam["arrBread"] = $arrBread;
     $datam["acc_active"] = $this->acc_active;
     $datam["content"] = $this->load->view("news/user_list", $data, true);
     $this->load->view($this->admin_layout, $datam);
 }
 function listview()
 {
     //if (!$this->cms->has_view($this->module)) redirect ("admin/error");
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $data_type = $this->adodbx->GetDataType($this->model->tbl);
     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 . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $table = $this->model->tbl;
     $totalRows = count($this->model->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by {$this->tbl_sort}";
     $arrData = $this->model->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     $arrUU = $this->conn->GetAll("select id_parent,group_concat(b.idx) as id_uu,group_concat(b.no_peraturan,'|',b.tentang order by b.idx separator ';') as data_uu from " . $this->model_uu->tbl . " a left join tb_peraturan_pembentukan_daerah b on a.id_peraturan=b.idx group by a.id_parent");
     $dataUU = array();
     if (cek_array($arrUU)) {
         foreach ($arrUU as $x => $val) {
             $dataUU[$val["id_parent"]] = $val;
         }
     }
     $data["dataUU"] = $dataUU;
     $config['base_url'] = $this->module . "listview";
     $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["acc_active"] = "guestbook";
     $data["arrData"] = $arrData;
     $this->_render_page($this->module . "v_list", $data, true);
 }
Exemplo n.º 4
0
 function link_list()
 {
     $cat_idx = $this->input->get_post("cat_id");
     $arrLinkIndex[] = "Category";
     $where[] = " publish=1 ";
     if ($cat_idx) {
         $where[] = "category={$cat_idx}";
         $arrLinkIndex[] = $this->conn->GetOne("select category from " . $this->model->tbl_link_category . " where idx={$cat_idx}");
     } else {
         $arrLinkIndex[] = "All";
     }
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $field = "category_name,name,link_url,description";
     if ($this->input->get_post("q")) {
         $whereSqlx = get_where_from_searchbox($field);
         $where[] = "({$whereSqlx})";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $sql = " select a.*,b.category as category_name,coalesce(c.click_count,0) as click_count from " . $this->model->tbl . " a \n                left join " . $this->model->tbl_link_category . " b on a.category=b.idx\n                left join " . $this->model->tbl_link_count . " c on a.idx=c.id_link\n                where b.publish=1 and a.publish=1\n        ";
     //$arrData=$this->model->SearchRecordWhere(false," order by category,name");
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "10";
     $data["perPage"] = $perPage;
     $uriSegment = 3;
     $table = "({$sql}) a";
     $totalRows = count($this->adodbx->search_record_where($table, $whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by idx";
     $arrData = $this->adodbx->search_record_by_limit_where($table, $whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "link_list/";
     $config['per_page'] = $perPage;
     $config['total_rows'] = $totalRows;
     $config['uri_segment'] = $uriSegment;
     $config["suffix"] = $queryString;
     $config["first_url"] = $config["base_url"] . $queryString;
     $config['num_links'] = 2;
     $this->pagination->initialize($config);
     $data["arrData"] = $arrData;
     $data["arrLinkIndex"] = $arrLinkIndex;
     $data["category_list"] = $this->category_list(false);
     $this->_render_page("content_list", $data, true);
 }
Exemplo n.º 5
0
 function listview()
 {
     //if (!$this->cms->has_view($this->module)) redirect ("admin/error");
     $this->load->library('pagination');
     $table = $this->model->tbl;
     $queryString = rebuild_query_string();
     $data_type = $this->adodbx->GetDataType($table);
     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 . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $totalRows = $this->model->getTotalRecordWhere($whereSql);
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by {$this->tbl_sort}";
     //$arrData=$this->model->SearchRecordLimitWhere($whereSql,$perPage,$offset,$sortBy);
     $arrData = $this->model->search_record_by_limit_where($table, $whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "listview";
     $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;
     //pre($data["arrData"]);exit;
     $this->_render_page($this->module . "v_list", $data, true);
 }
Exemplo n.º 6
0
 function user_list()
 {
     if (!$this->cms->has_view($this->module)) {
         redirect($this->auth_error_page);
     }
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $field = "first_name,last_name,username";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     //$this->model= new account_manager_model();
     $uriSegment = 4;
     $totalRows = count($this->model->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by id";
     $arrData = $this->model->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "user_list";
     $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);
     if (cek_array($arrData)) {
         foreach ($arrData as $x => $val) {
             $arrData[$x]["groups"] = $this->conn->GetAll("select a.*,b.name from users_groups a left join groups b on a.group_id=b.id where user_id=" . $val["id"]);
         }
     }
     $data["arrData"] = $arrData;
     //$arrData=$this->model->group_search_record_where(false," order by id ");
     //$data["arrData"]=$arrData;
     $this->_render_page($this->module . "user_list2", $data, true);
 }
Exemplo n.º 7
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);
 }
Exemplo n.º 8
0
 function listview()
 {
     //if (!$this->cms->has_view($this->module)) redirect ("admin/error");
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $field = "name";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $table = $this->model->tbl;
     $totalRows = count($this->model->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by id_penghargaan";
     $arrData = $this->model->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "listview";
     $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["acc_active"] = "guestbook";
     $data["arrData"] = $arrData;
     $this->_render_page($this->module . "v_list", $data, true);
 }
Exemplo n.º 9
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);
 }
Exemplo n.º 10
0
 function user_list()
 {
     $queryString = rebuild_query_string();
     $q = $this->input->get_post("q");
     $field = "ip_address,password,salt,activation_code,forgotten_password_code,forgotten_password_time,remember_code,created_on,last_login,active,username,first_name,last_name,email,company,phone,handphone,nama,tanda_pengenal,nomor_pengenal,jenis_kelamin,tempat_lahir,tanggal_lahir,pekerjaan,golongan_darah,alamat,kode_pos,kabupaten_kota,propinsi,image";
     $whereSql = get_where_from_searchbox($field);
     $arrBread[] = array("text" => "" . $this->listText . "", "url" => "");
     $this->load->library('pagination');
     $perPage = 20;
     $uriSegment = 4;
     $totalRows = count($this->ammmodel->SearchRecordWhere($whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by username";
     $arrData = $this->ammmodel->SearchRecordLimitWhere($whereSql, $perPage, $offset, $sortBy);
     if (cek_array($arrData)) {
         foreach ($arrData as $x => $val) {
             $arrData[$x]["groups"] = (array) $this->ion_auth->get_users_groups($val["id"])->result_array();
         }
     }
     $config['base_url'] = $this->http_ref . "/index/";
     $config['per_page'] = $perPage;
     $config['total_rows'] = $totalRows;
     $config['uri_segment'] = $uriSegment;
     $config["suffix"] = $queryString;
     //$config['display_pages'] = FALSE;
     $this->pagination->initialize($config);
     $data["arrData"] = $arrData;
     $datam["arrBread"] = $arrBread;
     $datam["acc_active"] = $this->acc_active;
     $datam["content"] = $this->load->view("register/user_list", $data, true);
     $this->load->view($this->admin_layout, $datam);
 }
Exemplo n.º 11
0
 function link_list()
 {
     //if (!$this->cms->has_view($this->module)) redirect ("admin/error");
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $field = "category_name,name,link_url,description";
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     if ($this->input->get_post("cat_id")) {
         $where[] = " category=" . $this->input->get_post("cat_id");
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $sql = " select a.*,b.category as category_name from " . $this->model->tbl . " a \r\n                left join " . $this->model->tbl_link_category . " b on a.category=b.idx\r\n        ";
     //$arrData=$this->model->SearchRecordWhere(false," order by category,name");
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $table = "({$sql}) a";
     $totalRows = count($this->adodbx->search_record_where($table, $whereSql));
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by idx desc";
     $arrData = $this->adodbx->search_record_by_limit_where($table, $whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "link_list";
     $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->_render_page($this->module . "link_list", $data, true);
 }
 function listview()
 {
     //if (!$this->cms->has_view($this->module)) redirect ("admin/error");
     $this->load->library('pagination');
     $queryString = rebuild_query_string();
     $sql = "select a.*,b.kabupaten_2,c.detail_uu,d.detail_file,e.detail_file_peta from tb_batas_kabupaten a \n\t\t\tleft join \n\t\t\t(select id_parent,group_concat(id_kabupaten_2,':',kabupaten_2 separator ',') as kabupaten_2 from tb_batas_kabupaten_detail group by id_parent) b\n\t\t\t on a.idx=b.id_parent \n\t\t\t left join \n\t\t\t (select id_parent,group_concat(idx,'|',no_peraturan,'|',tentang separator ';') as detail_uu from \n\t\t\t (select a.id_parent,b.* from tb_batas_kabupaten_uu a left join tb_peraturan_pembentukan_daerah b on a.id_peraturan=b.idx) uu \n\t\t\t group by id_parent) c on a.idx=c.id_parent\n\t\t\t \n\t\t\t left join (select id_parent,group_concat(id,'|',file_name,'|',file_path separator ';') as detail_file from tb_batas_kabupaten_file group by id_parent) d\n\t\t\t on a.idx=d.id_parent \n\t\t\t \n\t\t\t left join (select id_parent,group_concat(id,'|',file_name,'|',file_path separator ';') as detail_file_peta from tb_batas_kabupaten_file_peta group by id_parent) e\n\t\t\t on a.idx=e.id_parent \n\t\t\t ";
     $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 . ")";
     }
     $whereSql = "";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $table = $this->model->tbl;
     $totalRows = $this->model->total_rows_where("({$sql}) a", $whereSql);
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by {$this->tbl_sort}";
     $arrData = $this->adodbx->search_record_by_limit_where("({$sql}) a", $whereSql, $perPage, $offset, $sortBy);
     /*
     		$arrUU=$this->conn->GetAll("select id_parent,group_concat(b.idx) as id_uu,group_concat(b.no_peraturan,'|',b.tentang order by b.idx separator ';') as data_uu from ".$this->model_uu->tbl." a left join tb_peraturan_pembentukan_daerah b on a.id_peraturan=b.idx group by a.id_parent");
     		$dataUU=array();
     		if(cek_array($arrUU)):
     			foreach($arrUU as $x=>$val):
     				$dataUU[$val["id_parent"]]=$val;
     			endforeach;
     		endif;
     		$data["dataUU"]=$dataUU;
     */
     $config['base_url'] = $this->module . "listview";
     $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["acc_active"] = "guestbook";
     $data["arrData"] = $arrData;
     $this->_render_page($this->module . "v_list", $data, true);
 }
Exemplo n.º 13
0
 function view($id)
 {
     if ($this->encrypt_status == TRUE) {
         $id_enc = $id;
         $id = decrypt($id);
     }
     $this->msg_ok = "Link updated successfully";
     $this->msg_fail = "Unable to update link";
     $act = $this->input->post("act") ? $this->input->post("act") : "";
     $arrData = $this->model->GetRecordData("idx={$id}");
     $arrData += $this->model_contact->GetRecordData("id_wa={$id}");
     $arrData += $this->model_sejarah->GetRecordData("id_wa={$id}");
     $arrData += $this->model_hak_atas_tanah->GetRecordData("id_wa={$id}");
     $arrData += $this->model_hayati->GetRecordData("id_wa={$id}");
     $arrData += $this->model_lembaga_adat->GetRecordData("id_wa={$id}");
     $arrData += $this->model_hukum_adat->GetRecordData("id_wa={$id}");
     $arrKab = $this->get_kab_kota_arr($arrData["id_propinsi"]);
     $arrPropinsi = m_lookup("propinsi2", "kode_bps", "nama");
     $arrWaKondisiFisik = m_lookup("wa_kondisi_fisik", "idx", "kondisi_fisik");
     $arrEkosistem = m_lookup("wa_jenis_ekosistem", "id_jenis_ekosistem", "jenis_ekosistem", "", " order by order_num asc ");
     $arrPotensiHayati = m_lookup("wa_potensi_hayati", "id_potensi_hayati", "nama_potensi_hayati", "", " order by idx asc ");
     $data["arr_propinsi"] = $arrPropinsi;
     $data["arr_kabupaten"] = $arrKab;
     $data["arr_wa_kondisi_fisik"] = $arrWaKondisiFisik;
     $data["arr_wa_ekosistem"] = $arrEkosistem;
     $data["arr_wa_potensihayati"] = $arrPotensiHayati;
     //nambahin
     $arrDataPotensiMap = array();
     $arrDataPotensi = $this->model_potensi_hayati->SearchRecordWhere("id_wa={$id}");
     if (cek_array($arrDataPotensi)) {
         foreach ($arrDataPotensi as $x => $val) {
             $arrDataPotensiMap[$val["id_potensi_hayati"]] = $val;
         }
     }
     $data["potensi"] = $arrDataPotensiMap;
     $data['arrAlamat'] = $this->model_cms_configuration->GetRecordData("id_key='alamat_laporan'");
     $data['arrEmail'] = $this->model_cms_configuration->GetRecordData("id_key='email'");
     $data['arrKontak'] = $this->model_cms_configuration->GetRecordData("id_key='kontak_laporan'");
     if ($act == "update") {
         // debug();
         $this->conn->StartTrans();
         $data = get_post();
         $data = $this->_add_editor($data);
         unset($data[$this->tbl_idx]);
         //pre($data);exit;
         $this->model->UpdateData($data, "{$this->tbl_idx}={$id}");
         $ok = $this->conn->CompleteTrans();
         $this->_proses_message($ok, $this->module . "view/{$id_enc}", $this->module . "view/{$id_enc}");
     }
     // debug();
     //-----------
     $this->load->library('pagination');
     $table_dok = 'wa_pengajuan_keberatan';
     $queryString = rebuild_query_string();
     $data_type = $this->adodbx->GetDataType($table_dok);
     foreach ($data_type as $x => $val) {
         if ($val == "C" || $val == "X") {
             $data["text"][] = $x;
         }
     }
     $col_text = $data["text"];
     $field = join(",", $col_text);
     $whereSql = get_where_from_searchbox($field);
     if ($this->input->get_post("q")) {
         $where[] = "(" . $whereSql . ")";
     }
     $whereSql = "id_wa = {$id}";
     if (cek_array($where)) {
         $whereSql .= join(" and ", $where);
     }
     $perPage = $this->input->get_post("pp") ? $this->input->get_post("pp") : "25";
     $data["perPage"] = $perPage;
     $uriSegment = 4;
     $totalRows = $this->model_wa_keberatan->getTotalRecordWhere($whereSql);
     $offset = $totalRows > $perPage ? (int) $this->uri->segment($uriSegment) : 0;
     $sortBy = " order by {$this->tbl_sort}";
     //$arrData=$this->model->SearchRecordLimitWhere($whereSql,$perPage,$offset,$sortBy);
     $arrDataDok = $this->model_wa_keberatan->search_record_by_limit_where($table_dok, $whereSql, $perPage, $offset, $sortBy);
     $config['base_url'] = $this->module . "view";
     $config['per_page'] = $perPage;
     $config['total_rows'] = $totalRows;
     $config['uri_segment'] = $uriSegment;
     $config["suffix"] = $queryString;
     $config["first_url"] = $config["base_url"] . $queryString;
     $this->pagination->initialize($config);
     $data["arrDataDok"] = $arrDataDok;
     //--------
     $data["data"] = $arrData;
     $data["pembagian_ruang"] = $this->model_pembagian_ruang->SearchRecordWhere("id_wa={$id}");
     $data["data_view2"] = $this->load->view($this->module . "v_view2", $data, true);
     $this->_render_page($this->module . "v_view", $data, true);
 }