当前位置: 首页>>代码示例>>PHP>>正文


PHP grocery_CRUD::order_by方法代码示例

本文整理汇总了PHP中grocery_CRUD::order_by方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::order_by方法的具体用法?PHP grocery_CRUD::order_by怎么用?PHP grocery_CRUD::order_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grocery_CRUD的用法示例。


在下文中一共展示了grocery_CRUD::order_by方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: daftar

 public function daftar()
 {
     $crud = new grocery_CRUD();
     //$crud->set_table('permohonan');
     $crud->set_table('vtdp');
     $crud->set_subject('Data Permohonan Izin TDP');
     $crud->columns('no_agenda', 'nosk', 'perusahaan', 'tglpermohonan', 'status', 'catatan_bo', 'lama_proses');
     $crud->set_primary_key('id', 'vtdp');
     //$crud->set_relation_n_n('perusahaan', 'tdp','perusahaan','permohonan_id','perusahaan_id','nama');
     //$crud->set_relation('spermohonan_id', 'spermohonan','status');
     $crud->display_as('no_agenda', 'No.Agenda');
     $crud->display_as('nosk', 'No.SK');
     $crud->display_as('perusahaan', 'Nama Perusahaan');
     $crud->display_as('lama_proses', 'Lama Proses');
     $crud->add_action('Hapus Data', '', site_url() . '/tdp/simpen_hapus', 'delete-icon');
     $crud->add_action('Edit Data', '', site_url() . '/tdp/ubah', 'edit-icon');
     $crud->add_action('Ubah Status Pemrosessan Data', '', 'tdp', 'proses-icon');
     $crud->add_action('Cetak Tanda Bukti', '', 'tdp/cetak_sk', 'tbukti-icon', '', 'penerimaan', 'bap', 'bukti');
     $crud->add_action('Cetak SK', '', 'tdp/cetak_sk', 'sk-icon', '', 'sk', 'skatas');
     $crud->where('ijin_id', '6');
     $crud->order_by('tglpermohonan desc,id desc,perusahaan', 'desc');
     $crud->unset_export();
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_delete();
     $crud->unset_read();
     $crud->set_crud_url_path(site_url(strtolower(__CLASS__ . "/" . __FUNCTION__)), site_url(strtolower(__CLASS__)));
     $output = $crud->render();
     $this->load->view('home.php');
     $this->load->view('vtdp_daftar.php', $output);
 }
开发者ID:ibnoe,项目名称:perijinanbontang,代码行数:31,代码来源:tdp.php

示例2: index

 public function index()
 {
     try {
         // General
         $crud = new grocery_CRUD();
         $crud->set_language("french");
         $crud->set_theme('bootstrap');
         $crud->set_table('sos_gen_frequence');
         $crud->set_subject('Fréquence');
         //relations
         //Master/child relations
         //Visual
         $crud->columns('name_frequence');
         $crud->display_as('name_frequence', 'Fréquence');
         $crud->order_by('name_frequence', 'desc');
         //unsets
         //Requireds
         $crud->required_fields('name_frequence');
         //Callbacks
         //field Types
         // Actions
         // Renders
         $output = $crud->render();
         $menu = new stdClass();
         $menu->n1 = true;
         $menu->lien3_3_1 = false;
         $menu->status = $this->session->userdata('status');
         $header = $this->navigation->home_f($menu);
         $data = array('output' => $output, 'header' => $header);
         $this->_example_output($data);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:34,代码来源:frequence.php

示例3: alamat

 public function alamat()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('twitter-bootstrap');
     $crud->set_table('alamat');
     $crud->order_by('id', 'desc');
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:rudianto,项目名称:gcci2,代码行数:9,代码来源:Coba.php

示例4: listar_transito

 public function listar_transito()
 {
     /*$establecimiento = $this->mantenimiento_transito->listarEstablecimiento();
     
     		foreach($establecimiento as $dato){
     			$est[$dato->cod_est] = $dato->raz_soc;
     		} */
     $crud = new grocery_CRUD();
     //$crud->set_theme('bootstrap');
     $crud->set_table('trans_lesacctra');
     $crud->columns('id', 'ano', 'ap_nm1', 'ap_nm2', 'nom_les', 'edad', 'tipo_edad', 'diresa', 'eess');
     $crud->set_subject('Ficha Transito');
     $nivelUsuario = $this->session->userdata("nivel");
     switch ($nivelUsuario) {
         case '8':
             $where = array('cod_eess' => $this->session->userdata("establecimiento"));
             $crud->where($where);
             break;
         case '7':
             //$where = "where cod_eess in(select cod_est FROM renace where subregion = '$diresa' and red = '$red' and microred = '$microred')";
             $where = array('microred' => $this->session->userdata("microred"), 'red' => $this->session->userdata("red"), 'cod_dir' => $this->session->userdata("diresa"));
             $crud->where($where);
             break;
         case '6':
             //$where = "where cod_eess in(select cod_est FROM renace where subregion = '$diresa' and red = '$red')";
             $where = array('red' => $this->session->userdata("red"), 'cod_dir' => $this->session->userdata("diresa"));
             $crud->where($where);
             break;
         case '5':
             $where = array('cod_dir' => $this->session->userdata("diresa"));
             $crud->where($where);
             break;
     }
     //$crud->field_type('establec', 'dropdown', $est);
     $crud->display_as("id", "ID")->display_as("ano", "AÑO")->display_as("ap_nm1", "APELLIDO PATERNO")->display_as("ap_nm2", "APELLIDO MATERNO")->display_as("nom_les", "NOMBRES")->display_as("edad", "EDAD")->display_as("tipo_edad", "TIPO")->display_as("diresa", "DIRESA")->display_as("eess", "ESTABLECIENTO DE SALUD");
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_read();
     $crud->unset_print();
     $crud->unset_export();
     $crud->unset_delete();
     $crud->order_by('id', 'desc');
     $crud->add_action('Eliminar Ficha', base_url() . 'assets/images/close.png', 'modulotransito/borrarFichatransito', 'borrar-icon');
     $crud->add_action('Vista previa', '', 'modulotransito/ver_ficha_transito', 'read-icon');
     $crud->add_action('Editar Ficha Transito', '', 'modulotransito/modificacion_transito', 'edit-icon');
     $output = $crud->render();
     $usuario = $this->session->userdata("usuario");
     $accion = 'Listar Casos Accidentes de Transito';
     $this->login_model->auditoriaOperador($usuario, $accion);
     $this->layout->view('listar_transito', $output);
 }
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:51,代码来源:modulotransito.php

示例5: index

 public function index()
 {
     $anio = array();
     for ($i = 2000; $i <= 2020; $i++) {
         $anio[$i] = $i;
     }
     $crud = new grocery_CRUD();
     $crud->set_table('student');
     $crud->columns('registroId', 'ano', 'datos', 't');
     $crud->order_by('ano', 'asc');
     $crud->display_as('registroId', 'Item')->display_as('ano', 'A&ntilde;o')->display_as('registroId', 'Item');
     $crud->set_subject('Datos');
     $crud->field_type('ano', 'dropdown', $anio);
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:16,代码来源:student.php

示例6: index

 public function index($log_type = NULL)
 {
     $this->load->model('shared/log_model');
     $this->config->load('grocery_crud');
     $this->config->set_item('grocery_crud_character_limiter', 0);
     $crud = new grocery_CRUD();
     if ($crud->getState() == 'list') {
         // get all known log types
         $log_types = $this->log_model->get_log_types();
         $this->views['content'] = $this->load->view('admin/log/action_selector', array('log_types' => $log_types, 'selected_log_type' => $log_type), TRUE);
         $this->javascript[] = $this->load->view('admin/log/js/action_selector.js', NULL, TRUE);
     }
     if (!is_null($log_type) && $log_type != 'ajax_list' && $log_type != 'export' && $log_type != 'print' && $log_type != 'ajax_list_info') {
         $crud->where(array('action' => $log_type));
         $crud->unset_columns('action');
     }
     $crud->set_theme('bootstrap');
     $crud->set_table('log');
     $crud->set_subject('Logs');
     // Op twee velden orderen. Grocerycrud houd zich niet aan de Codeigniter active record
     // maar dit werkt.
     $crud->order_by('date_created desc, id', 'desc');
     $crud->columns('date_created', 'action', 'message', 'user_id');
     $crud->set_relation('user_id', 'user', 'screen_name');
     $crud->display_as('user_id', 'Gebruiker');
     $crud->display_as('date_created', 'Tijd');
     $crud->display_as('action', 'Actie');
     $crud->display_as('message', 'Bericht');
     $crud->display_as('ip_hash', 'IP-hash');
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_delete();
     // render the crud HTML
     $crud_output = $crud->render();
     //get the needed css and javascript files
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     if (isset($this->views['content'])) {
         $this->views['content'] .= $crud_output->output;
     } else {
         $this->views['content'] = $crud_output->output;
     }
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:44,代码来源:TT_log.php

示例7: index

 public function index()
 {
     $array = $this->mapas_model->obtenerIndividual();
     $k = 0;
     foreach ($array as $valor) {
         $datos[$valor->cie_10] = $valor->diagno;
         $k++;
     }
     $crud = new grocery_CRUD();
     $crud->set_table('estratos');
     $crud->columns('id', 'enfermedad', 'semana', 'estrato_1', 'estrato_2', 'estrato_3', 'estrato_4', 'estrato_5', 'tipo', 'habitantes');
     $crud->order_by('id,enfermedad', 'asc');
     $crud->display_as('id', 'from estratos')->display_as('id', 'Item');
     $crud->set_subject('Estrato');
     $crud->field_type('enfermedad', 'dropdown', $datos);
     $crud->field_type('tipo', 'dropdown', array('1' => 'Casos', '2' => 'Incidencia', '3' => 'Estrat. Casos'));
     $output = $crud->render();
     $this->_example_output($output);
 }
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:19,代码来源:estratos.php

示例8: index

 public function index()
 {
     try {
         // General
         $crud = new grocery_CRUD();
         $crud->set_language("french");
         $crud->set_theme('bootstrap');
         $crud->set_table('sos_utilisateur');
         $crud->set_subject('Utilisateurs');
         //relations
         //Master/child relations
         //Visual
         $crud->columns('nom_utilisateur', 'prenom_utilisateur', 'identifiant_utilisateur', 'motdepass_utilisateur', 'status', 'titre');
         $crud->display_as('nom_utilisateur', 'Nom')->display_as('prenom_utilisateur', 'Prénom')->display_as('identifiant_utilisateur', 'Id')->display_as('motdepass_utilisateur', 'Mot de pass');
         $crud->order_by('prenom_utilisateur', 'desc');
         //unsets
         //Requireds
         $crud->required_fields('identifiant_utilisateur', 'motdepass_utilisateur', 'status');
         //Callbacks
         //field Types
         $crud->field_type('status', 'dropdown', array('0' => 'Utilisateur', '1' => 'Super Administrateur', '2' => 'Administrateur', '3' => 'Web Master', '4' => 'Psychologue', '5' => 'Ecoute téléphonique'));
         // Actions
         if ($this->session->userdata('status') == '0' or $this->session->userdata('status') == '2' or $this->session->userdata('status') == '4' or $this->session->userdata('status') == '5') {
             $crud->unset_delete();
         }
         // Renders
         $output = $crud->render();
         $menu = new stdClass();
         $menu->n1 = true;
         $menu->lien3_7 = false;
         $menu->status = $this->session->userdata('status');
         $header = $this->navigation->home_f($menu);
         $data = array('output' => $output, 'header' => $header);
         $this->_example_output($data);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:38,代码来源:utilisateur.php

示例9: index

 public function index()
 {
     try {
         // General
         $crud = new grocery_CRUD();
         $crud->set_language("french");
         $crud->set_theme('bootstrap');
         $crud->set_table('sos_editor');
         $crud->set_subject('Ecrit');
         //relations
         //Master/child relations
         //Visual
         $crud->columns('abrev', 'file_url', 'type');
         $crud->display_as('file_url', 'Ecrits');
         $crud->field_type('type', 'dropdown', array('1' => 'Attestation', '2' => 'Rapport'));
         $crud->display_as('abrev', 'Description');
         $crud->order_by('abrev', 'desc');
         $crud->set_field_upload('file_url', 'assets/uploads/models');
         //unsets
         //Requireds
         $crud->required_fields('abrev', 'file_url', 'type');
         //Callbacks
         //field Types
         // Actions
         // Renders
         $output = $crud->render();
         $menu = new stdClass();
         $menu->n1 = true;
         $menu->lien3_1_8 = false;
         $menu->status = $this->session->userdata('status');
         $header = $this->navigation->home_f($menu);
         $data = array('output' => $output, 'header' => $header);
         $this->_example_output($data);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
开发者ID:simplonco,项目名称:sos_femmes,代码行数:37,代码来源:editor.php

示例10: quicklink

 public function quicklink()
 {
     $crud = new grocery_CRUD();
     $crud->set_table('cms_quicklink');
     $crud->set_subject('Quick Link');
     $crud->columns('navigation_id');
     $crud->edit_fields('navigation_id');
     $crud->add_fields('navigation_id');
     $crud->display_as('navigation_id', 'Navigation Name');
     $crud->order_by('index', 'asc');
     $crud->set_relation('navigation_id', 'cms_navigation', 'navigation_name');
     $crud->callback_before_insert(array($this, 'before_insert_quicklink'));
     $output = $crud->render();
     $this->view('grocery_CRUD', $output, 'main_quicklink_management');
 }
开发者ID:rado-tsvetkov,项目名称:No-CMS,代码行数:15,代码来源:main.php

示例11: kegiatan_lama

 public function kegiatan_lama()
 {
     $status = $this->input->get("status");
     $crud = new grocery_CRUD();
     $crud->where("tbl_kegiatan_transaksi.status", "Lama");
     $crud->set_table('tbl_kegiatan_transaksi');
     $crud->set_subject('Kegiatan Lama');
     $crud->set_relation('change_by', 'tbl_user', 'email');
     $crud->set_relation('id_user', 'tbl_user', '{nama_depan} {nama_belakang}');
     $crud->set_relation('id_kegiatan_butir', 'view_kegiatan_butir', '{unsur} - {subunsur} - {butir}');
     $crud->set_primary_key('id_kegiatan_butir', 'view_kegiatan_butir');
     $crud->required_fields('tanggal_kegiatan', 'tanggal_kegiatan_selesai');
     $crud->fields('id_user', 'id_kegiatan_butir', 'tanggal_kegiatan', 'tanggal_kegiatan_selesai', 'lembur', 'keterangan', 'status', 'change_by', 'change_date');
     $crud->columns('id_user', 'id_kegiatan_butir', 'tanggal_kegiatan', 'tanggal_kegiatan_selesai', 'status');
     $crud->display_as("id_kegiatan_butir", "Butir Kegiatan")->display_as("tanggal_kegiatan", "Tanggal Mulai")->display_as("tanggal_kegiatan_selesai", "Tanggal Selesai")->display_as("id_user", "Oleh")->display_as("change_date", "Tanggal")->display_as("id_periode", "Periode")->display_as("id_kegiatan_jabatan", "Bertindak Sebagai");
     $crud->callback_add_field('id_user', array($this, '_form_get_user_callback'));
     $crud->callback_edit_field('id_user', array($this, '_form_get_user_callback'));
     $crud->callback_add_field('status', array($this, '_kegiatan_lama_get_status_callback'));
     $crud->callback_edit_field('status', array($this, '_kegiatan_lama_get_status_callback'));
     $crud->callback_before_update(array($this, 'get_change_by_callback'));
     $crud->callback_before_insert(array($this, 'get_change_by_callback'));
     $crud->callback_field('change_date', array($this, 'format_date_callback'));
     $crud->change_field_type('id_user', 'readonly');
     $crud->change_field_type('change_by', 'readonly');
     $crud->change_field_type('change_date', 'readonly');
     $crud->add_action('Unggah Bukti', '', 'pegawai/daftar_kegiatan_berkas', 'fa fa-upload');
     $crud->unset_read();
     $crud->order_by('id_kegiatan_transaksi', 'desc');
     $sitemap = $this->get_sitemap();
     $output = $crud->render($sitemap);
     $this->load->view('theme/theme_pegawai', $output);
 }
开发者ID:selametsubu,项目名称:simpak,代码行数:32,代码来源:pegawai.php

示例12: listadoNotificacion

 public function listadoNotificacion()
 {
     if ($this->session->userdata('nivel') != 5 or $this->session->userdata('institucion') != 'A') {
         $this->session->set_flashdata('error', 'Su nivel de usuario no le permite realizar este proceso');
         redirect(site_url("index/principal"), 301);
     }
     $anio = array();
     for ($i = date("Y") - 1; $i <= date("Y"); $i++) {
         $anio[$i] = $i;
     }
     $semanas = array();
     for ($i = 1; $i <= 53; $i++) {
         $semanas[$i] = $i;
     }
     $usuario = $this->session->userdata('usuario');
     $carpeta = getcwd() . "/uploads/" . $usuario . "/";
     if (!file_exists($carpeta)) {
         mkdir(getcwd() . "/uploads/" . $usuario, 0777);
     }
     $subr = $this->frontend_model->mostrarDiresa($this->session->userdata('diresa'));
     $subregion = array();
     foreach ($subr as $dato) {
         $subregion[$dato->codigo] = $dato->nombre;
     }
     $rd = $this->frontend_model->buscarRedes($this->session->userdata('diresa'));
     $red = array();
     foreach ($rd as $dato) {
         $red[$dato->codigo] = $dato->nombre;
     }
     $mrd = $this->frontend_model->buscaMicroredes($this->session->userdata('diresa'));
     $microred = array();
     foreach ($mrd as $dato) {
         $microred[$dato->codigo] = $dato->nombre;
     }
     $crud = new grocery_CRUD();
     $crud->set_table('telematica');
     $crud->columns('ano', 'semana', 'diresa', 'red', 'microred', 'establecimiento', 'archivo', 'usuario', 'fecha', 'enviado');
     $crud->fields('ano', 'semana', 'diresa', 'red', 'microred', 'establecimiento', 'archivo');
     $crud->display_as('ano', 'A&ntilde;o');
     $crud->display_as('enviado', 'Estado');
     $crud->field_type('ano', 'dropdown', $anio);
     $crud->field_type('semana', 'dropdown', $semanas);
     $crud->field_type('diresa', 'dropdown', $subregion);
     $crud->field_type('red', 'dropdown', $red);
     //$crud->field_type('microred','dropdown',$microred);
     $crud->field_type('enviado', 'dropdown', array('1' => 'Notificado', '2' => 'Pendiente'));
     //$crud->where(array('ano'=>date('Y')));
     $crud->where(array('diresa' => $this->session->userdata('diresa')));
     $crud->order_by('ano', 'DESC');
     $crud->set_subject('Notificaci&oacute;n');
     $crud->set_field_upload('archivo', 'uploads/' . $usuario);
     $crud->unset_add();
     $crud->unset_read();
     //$crud->unset_delete();
     $crud->unset_edit();
     $crud->unset_export();
     $crud->callback_after_insert(array($this, 'log_usuario_after_insert'));
     ///////////////////////////////////////////////////////////////////////////////
     $crud->add_action_peru('A&ntilde;adir Notificaci&oacute;n', '', 'pntRegistro', 'add-icon');
     ///////////////////////////////////////////////////////////////////////////////
     //$crud->add_action('A&ntilde;adir informaci&oacute;n', base_url().'public/images/telematica.gif', 'pnt/adicionar','');
     $crud->add_action('Efectuar notificaci&oacute;n', base_url() . 'public/images/contact.png', 'pnt/envio', '');
     $output = $crud->render();
     $this->_example_output1($output);
 }
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:65,代码来源:pnt.php

示例13: persutujuan_daftar_kegiatan_berkas

 public function persutujuan_daftar_kegiatan_berkas()
 {
     try {
         $crud = new grocery_CRUD();
         $state = $crud->getState();
         $id_kegiatan_transaksi = $this->uri->segment(3);
         $crud->where('id_kegiatan_transaksi', $id_kegiatan_transaksi);
         $crud->set_table('tbl_kegiatan_transaksi_berkas');
         $crud->set_subject('Daftar Berkas Pegawai');
         $crud->set_field_upload('berkas', 'assets/uploads/berkas');
         $crud->fields('no', 'judul', 'berkas', 'keterangan');
         $crud->columns('no', 'judul', 'berkas', 'keterangan');
         $crud->order_by('id_kegiatan_transaksi_berkas', 'desc');
         //$crud->change_field_type('nama_depan', 'readonly');
         $crud->unset_save();
         $crud->unset_add();
         $crud->unset_edit();
         $crud->unset_read();
         $crud->unset_delete();
         $sitemap = $this->get_sitemap();
         $output = $crud->render($sitemap);
         $this->load->view('theme/theme_pegawai', $output);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
开发者ID:selametsubu,项目名称:e-ppid,代码行数:26,代码来源:penilai.php

示例14: irasCampos

 public function irasCampos()
 {
     if (empty($this->session_id)) {
         redirect(site_url("index/login"), 301);
     }
     $reporta = array('ano' => date('Y'), 'semana' => date('W') - 2);
     $this->reportes_model->registraCalidad($reporta);
     $this->calidad_model->edasCampos();
     $crud = new grocery_CRUD();
     $crud->set_table('irasDefunciones');
     $crud->columns('ano', 'semana', 'sub_reg_nt', 'red', 'microred', 'e_salud', 'ubigeo', 'ira_m2', 'ira_2_11', 'ira_1_4a', 'neu_2_11', 'neu_1_4a', 'ngr_m2', 'ngr_2_11', 'ngr_1_4a');
     $crud->display_as('ano', 'A&ntilde;o');
     switch ($this->session->userdata('nivel')) {
         case 4:
             $accesar = $this->session->userdata('equipo');
             break;
         case 5:
             $accesar = $this->session->userdata('diresa');
             $crud->or_where(array('sub_reg_nt' => $accesar));
             break;
         case 6:
             $accesar = $this->session->userdata('diresa');
             $accesar1 = $this->session->userdata('red');
             $crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1));
             break;
         case 7:
             $accesar = $this->session->userdata('diresa');
             $accesar1 = $this->session->userdata('red');
             $accesar2 = $this->session->userdata('microred');
             $crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
             break;
         case 8:
             $accesar = $this->session->userdata('establecimiento');
             $crud->where(array('e_salud' => $accesar));
             break;
     }
     $crud->order_by('semana');
     $crud->unset_add();
     $crud->unset_read();
     $crud->unset_edit();
     //$crud->unset_delete();
     //$crud->unset_export();
     $crud->unset_print();
     $crud->add_action('Editar', '', 'calidad/modIras', 'edit-icon');
     $crud->callback_after_delete(array($this, 'log_iras_registro_after_delete'));
     $output = $crud->render();
     $this->layout->view('irasCampos.php', $output);
 }
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:48,代码来源:calidad.php

示例15: listadoIndividual

 public function listadoIndividual()
 {
     $sub = $this->frontend_model->buscarDiresas();
     $subr = array();
     foreach ($sub as $dato) {
         $subr[$dato->codigo] = $dato->nombre;
     }
     $dist = $this->frontend_model->listarDistritos();
     $ubigeo = array();
     foreach ($dist as $dato) {
         $ubigeo[$dato->ubigeo] = $dato->nombre;
     }
     $enf = $this->frontend_model->mostrarDiagnostico();
     $enfermedad = array();
     foreach ($enf as $dato) {
         $enfermedad[$dato->cie_10] = $dato->diagno;
     }
     $tdx = $this->frontend_model->mostrarTipo();
     $tipoDx = array();
     foreach ($tdx as $dato) {
         $tipoDx[$dato->codigo] = $dato->denominacion;
     }
     $filtro = array();
     $this->input->post('diresa') ? $filtro['sub_reg_nt'] = $this->input->post('diresa') : '';
     $this->input->post('redes') ? $filtro['red'] = $this->input->post('redes') : '';
     $this->input->post('microred') ? $filtro['microred'] = $this->input->post('microred') : '';
     $this->input->post('establec') ? $filtro['e_salud'] = $this->input->post('establec') : '';
     $this->input->post('departamento') ? $filtro['substr(ubigeo,1,2)'] = $this->input->post('departamento') : '';
     $this->input->post('provincia') ? $filtro['substr(ubigeo,1,4)'] = $this->input->post('provincia') : '';
     $this->input->post('distrito') ? $filtro['ubigeo'] = $this->input->post('distrito') : '';
     $this->input->post('diagno') ? $filtro['diagnostic'] = $this->input->post('diagno') : '';
     $this->input->post('tipoDx') ? $filtro['tipo_dx'] = $this->input->post('tipoDx') : '';
     $this->input->post('ano_ini') ? $filtro['ano'] = $this->input->post('ano_ini') : '';
     $this->input->post('semana_ini') ? $filtro['semana'] = $this->input->post('semana_ini') : '';
     $this->input->post('apepat') ? $filtro['apepat'] = $this->input->post('apepat') : '';
     $crud = new grocery_CRUD();
     $crud->set_theme("datatables");
     $crud->set_table('individual');
     $crud->columns('ano', 'semana', 'diagnostic', 'tipo_dx', 'subregion', 'sub_reg_nt', 'ubigeo', 'sexo', 'apepat', 'apemat', 'nombres');
     $crud->display_as('ano', 'A&ntilde;o')->display_as('diagnostic', 'Diagn&oacute;stico')->display_as('subregion', 'Diresa')->display_as('sub_reg_nt', 'Notificante')->display_as('ubigeo', 'Distrito')->display_as('tipo_dx', 'Tipo')->display_as('apepat', 'Ap. Paterno')->display_as('apemat', 'Ap. Materno');
     $crud->field_type('subregion', 'dropdown', $subr);
     $crud->field_type('sub_reg_nt', 'dropdown', $subr);
     $crud->field_type('ubigeo', 'dropdown', $ubigeo);
     $crud->field_type('diagnostic', 'dropdown', $enfermedad);
     $crud->field_type('tipo_dx', 'dropdown', $tipoDx);
     $crud->field_type('sexo', 'dropdown', array('M' => 'Masculino', 'F' => 'Femenino'));
     if ($this->input->post()) {
         if ($this->session->userdata('institucion') == 'A') {
             $crud->where($filtro);
         } else {
             $crud->where($filtro);
             $crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
         }
     } else {
         $crud->where(array('ano' => date('Y')));
         switch ($this->session->userdata('nivel')) {
             case 4:
                 $accesar = $this->session->userdata('equipo');
                 if ($this->session->userdata('institucion') != 'A') {
                     $crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion')));
                 }
                 break;
             case 5:
                 $accesar = $this->session->userdata('diresa');
                 if ($this->session->userdata('institucion') != 'A') {
                     $crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'subregion' => $accesar));
                 } else {
                     $crud->where(array('subregion' => $accesar));
                     $crud->or_where(array('sub_reg_nt' => $accesar));
                 }
                 break;
             case 6:
                 $accesar = $this->session->userdata('diresa');
                 $accesar1 = $this->session->userdata('red');
                 if ($this->session->userdata('institucion') != 'A') {
                     $crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1));
                 } else {
                     $crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1));
                 }
                 break;
             case 7:
                 $accesar = $this->session->userdata('diresa');
                 $accesar1 = $this->session->userdata('red');
                 $accesar2 = $this->session->userdata('microred');
                 if ($this->session->userdata('institucion') != 'A') {
                     $crud->where(array('substr(e_salud,7,1)' => $this->session->userdata('institucion'), 'sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
                 } else {
                     $crud->where(array('sub_reg_nt' => $accesar, 'red' => $accesar1, 'microred' => $accesar2));
                 }
                 break;
             case 8:
                 $accesar = $this->session->userdata('establecimiento');
                 $crud->where(array('e_salud' => $accesar));
                 break;
         }
     }
     $crud->limit(1000);
     $crud->order_by('semana', 'DESC');
     $crud->set_subject('Individual');
     $crud->unset_add();
//.........这里部分代码省略.........
开发者ID:alejandrob1519,项目名称:nwsp,代码行数:101,代码来源:individual.php


注:本文中的grocery_CRUD::order_by方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。