6, //cell width 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'T', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => 'B', //font type 'LN_SIZE' => 6, //line size for one row 'BG_COLOR' => array(255, 255, 255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.2, //border size 'BRD_TYPE' => '1', //border type, can be: 0, 1 or a combination of: "LRTB" 'TEXT' => '', //text ); var $table_po_header1_type = array( 'WIDTH' => 6, //cell width 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'M', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => 'B', //font type 'LN_SIZE' => 6, //line size for one row 'BG_COLOR' => array(255, 255, 255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.2, //border size 'BRD_TYPE' => '1', //border type, can be: 0, 1 or a combination of: "LRTB" 'TEXT' => '', //text ); var $table_po_header2_type = array( 'WIDTH' => 6, //cell width 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'T', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => 'B', //font type 'LN_SIZE' => 6, //line size for one row 'BG_COLOR' => array(255, 255, 255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.5, //border size 'BRD_TYPE' => 'TB', //border type, can be: 0, 1 or a combination of: "LRTB" 'TEXT' => '', //text ); var $table_po_header3_type = array( 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'M', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => 'B', //font type 'LN_SIZE' => 6, //line size for one row 'BG_COLOR' => array(255, 255, 255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.2, //border size 'BRD_TYPE' => '1', //border type, can be: 0, 1 or a combination of: "LRTB" 'TEXT' => '', //text ); var $table_po_footer_type = array( 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'M', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => '', //font type 'LN_SIZE' => 8, //line size for one row 'BG_COLOR' => array(255,255,255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.1, //border size 'BRD_TYPE' => 'BT', //border type, can be: 0, 1 or a combination of: "LRTB" ); var $table_default_data_type = array( 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'M', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => '', //font type 'LN_SIZE' => 6, //line size for one row 'BG_COLOR' => array(255,255,255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.1, //border size 'BRD_TYPE' => 'LR', //border type, can be: 0, 1 or a combination of: "LRTB" ); var $table_default_footer_type = array( 'T_COLOR' => array(0,0,0), //text color 'T_SIZE' => 10, //font size 'T_FONT' => 'Arial', //font family 'T_ALIGN' => 'C', //horizontal alignment, possible values: LRC (left, right, center) 'V_ALIGN' => 'M', //vertical alignment, possible values: TMB(top, middle, bottom) 'T_TYPE' => '', //font type 'LN_SIZE' => 8, //line size for one row 'BG_COLOR' => array(255,255,255), //background color 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => 0.1, //border size 'BRD_TYPE' => 'LRT', //border type, can be: 0, 1 or a combination of: "LRTB" ); var $table_default_table_type = array( 'TB_ALIGN' => 'L', //table align on page 'L_MARGIN' => 1, //space to the left margin 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => '0.3', //border size ); var $table_group = array( 'TB_ALIGN' => 'L', //table align on page 'L_MARGIN' => 2, //space to the left margin 'BRD_COLOR' => array(0,0,0), //border color 'BRD_SIZE' => '0.3', //border size 'LN_SIZE' => 4 //line size for one row ); function Display() { parent::Model(); $this->load->library('session'); } function header() { $this->data["real_name"] = $this->session->userdata('s_username'); if ($this->session->userdata('s_username') != '') { $display_menu = '
  • Home
  • '; $this->data["menu"] = $display_menu.$this->menu(); $this->load->view('admin/header_page',$this->data); } else { redirect(base_url()); } } function footer() { $this->load->view('admin/footer_page',''); } function check_module($module_name) { if ($module_name <> $this->session->userdata('s_module')) { $this->session->set_userdata('s_keyword',''); $this->session->set_userdata('s_module',$module_name); } } function menu($id_parent = 0) { $this->db->select("id_menu, name, id_parent, links, seq"); $this->db->where("id_parent",$id_parent); $this->db->order_by("seq"); $query = $this->db->get("menu"); $row_count = $query->num_rows(); $display_menu = ""; if ($row_count > 0) { foreach($query->result() as $result) { $display_menu .= '
  • '.$result->name.''; $display_submenu = $this->menu($result->id_menu); if ($display_submenu != '') { $display_menu .= ""; } $display_menu .= '
  • '; } } return $display_menu; } function menu_products($id_parent = '0') { $this->db->select("id_category, name, id_parent,ind_category"); $this->db->where("id_parent",$id_parent); $query = $this->db->get("product_category"); // echo $this->db->last_query(); $row_count = $query->num_rows(); $display_menu = ""; $i=0; if ($row_count > 0) { foreach($query->result() as $result) { //echo "main_menu:".$result->id_category."
    "; if($this->session->userdata('s_lang') == 0) { $display_menu .= '
  • id_category.'">'.$result->name.""; } else { $display_menu .= '
  • id_category.'">'.$result->ind_category.""; } $display_submenu = $this->menu_products($result->id_category); if ($display_submenu != '') { //echo "sub_menu:".$result->id_category."
    "; $display_menu .= ""; } $display_menu .= '
  • '; $i++; } } return $display_menu; } function generate_form($data, $field_list, $field_type, $field_size, $field_value, $field_title = "") { $class = "input_text"; for($i = 0; $i < count($field_list); $i++) { //echo $field_list[$i]." ".$field_type[$i]."
    "; $field_name = $field_list[$i]; $id = "f_".$field_name; $type = $field_type[$i]; $attribute = $field_size[$i]; $title = $field_title[$i]; if ($field_value != 0) { $value = $field_value[$field_name]; } else { $value = ""; } switch($type) { //view //hidden case "hidden" : $data[$id] = $value; break; //input text case "input" : $data[$id] = array( "name" => $id, "id" => $id, "value" => $value, "title" => $title, "size" => $attribute, "class" => $class); break; //input text - date case "date" : if ($value == "") { $value = date("d/m/Y"); } else { $value = $this->tfunctions->convert_date($value,2); } $data[$id] = array( "name" => $id, "id" => $id, "value" => $value, "title" => $title, "size" => $attribute, "class" => "input_text input_date"); break; //label case "label" : $data[$id] = array( "name" => $id, "id" => $id, "value" => $value, "size" => $attribute, "class" => "input_label"); break; case "number" : $data[$id] = array( "name" => $id, "id" => $id, "value" => $value, "size" => $attribute, "class" => "input_number"); break; case "textarea" : $size = explode(":",$attribute); $rows = $size[0]; $cols = $size[1]; $data[$id] = array( "name" => $id, "id" => $id, "value" => $value, "rows" => $rows, "cols" => $cols, "class" => $class); break; //dropdown case "dropdown" : $data = $this->create_dropdown($data,$attribute,$id); $data[$id."_selected"] = $value; break; } } return $data; } //created by Immanuel G. Souhoka 20.07.2009 09:04 function create_dropdown($data, $type, $id) { $options = array(); //predefined drop down type switch($type) { case "bool" : $options[''] = ""; $options['Y'] = 'Y'; $options['N'] = 'N'; $extras = 'id="'.$id.'" class="search_class ui-corner-all"'; $data[$id."_options"] = $options; $data[$id."_extras"] = $extras; break; case "jenis_kelamin" : $options[''] = ""; $options['P'] = 'Perempuan'; $options['L'] = 'Laki-Laki'; $extras = 'id="'.$id.'" class="search_class ui-corner-all"'; $data[$id."_options"] = $options; $data[$id."_extras"] = $extras; break; case "status_kawin" : $this->db->select("id_status, status_kawin"); $this->db->from("default_status"); $query = $this->db->get(); $row_count = $query->num_rows(); $display_menu = ""; $options[''] = ""; if ($row_count > 0) { foreach($query->result() as $result) { $options[$result->id_status] = $result->status_kawin; } } $extras = 'id="'.$id.'" class="search_class ui-corner-all"'; $data[$id."_options"] = $options; $data[$id."_extras"] = $extras; break; case "hubungan" : $this->db->select("id_hubungan, kode_hubungan, hubungan"); $this->db->from("default_hubungan"); $query = $this->db->get(); $row_count = $query->num_rows(); $display_menu = ""; $options[''] = ""; if ($row_count > 0) { foreach($query->result() as $result) { $options[$result->id_hubungan] = $result->kode_hubungan." - ".$result->hubungan; } } $extras = 'id="'.$id.'" onChange="set_kk();" class="search_class ui-corner-all"'; $data[$id."_options"] = $options; $data[$id."_extras"] = $extras; break; case "sektor" : $this->db->select("sektor"); $this->db->from("data_warga"); $this->db->where("id_jemaat",$this->session->userdata('s_id_jemaat')); $query = $this->db->get(); $row_count = $query->num_rows(); $display_menu = ""; $options[''] = ""; if ($row_count > 0) { foreach($query->result() as $result) { $options[$result->sektor] = $result->sektor; } } $extras = 'id="'.$id.'" class="search_class ui-corner-all"'; $data[$id."_options"] = $options; $data[$id."_extras"] = $extras; break; } return $data; } } ?>