本文整理汇总了PHP中grocery_CRUD::field_type方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::field_type方法的具体用法?PHP grocery_CRUD::field_type怎么用?PHP grocery_CRUD::field_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grocery_CRUD
的用法示例。
在下文中一共展示了grocery_CRUD::field_type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usuarios
function usuarios()
{
$crud = new grocery_CRUD();
$crud->set_table('usuarios');
$crud->set_theme('datatables');
$crud->set_language('spanish');
$crud->set_subject('Usuario');
$crud->field_type('clave', 'password');
//-> Display as
$crud->display_as('id_nivel', 'Nivel');
$crud->display_as('id_estatus', 'Estado');
$crud->set_field_upload('foto', 'assets/uploads/users');
//-> Columnas
$crud->columns('usuario', 'nombre', 'email', 'id_nivel');
//-> Relaciones
$crud->set_relation('id_nivel', 'usuario_niveles', 'descripcion');
$crud->set_relation('id_estatus', 'usuario_estatus', 'descripcion');
//-> Output
$output = $crud->render();
$data['titulo'] = "USUARIOS";
$this->load->view('include/head');
$this->load->view('include/header');
$this->load->view('include/sidebar');
$this->load->view('admin/main', $data);
$this->load->view('admin/grocery_crud', $output);
$this->load->view('include/footer');
}
示例2: enfants_window
public function enfants_window($id)
{
$this->id_demande = $id;
try {
$crud = new grocery_CRUD();
$crud->set_language("french");
$crud->set_theme('bootstrap');
$crud->where('id_from_demande', $this->id_demande);
$crud->set_table('sos_enfants');
$crud->set_subject('Enfant');
$crud->unset_add();
$crud->unset_delete();
$crud->field_type('id_from_demande', 'hidden', $this->id_demande);
$crud->unset_edit_fields('id_from_kids');
$crud->set_relation('id_from_kids', 'sos_kids', "id_kid");
$crud->set_relation('recu', 'sos_gen_recu', "name_recu", null, 'name_recu ASC');
$crud->set_relation_n_n('accompagniement', 'sos_relation_accompagniement_kid', 'sos_gen_accompagniement_kid', 'id_from_enfants', 'id_from_accompagniement_kid', 'name_accompagniement_kid');
$crud->set_relation_n_n('activite', 'sos_relation_activite_kid', 'sos_gen_activite_kid', 'id_from_enfants', 'id_from_activite_kid', 'name_activite_kid');
$crud->columns('enfant', 'recu', 'activite', 'accompagniement', 'commentaire_enfant');
//$crud->display_as('id_from_kids', 'Enfants');
$crud->display_as('accompagniement', 'Accompagnement');
$crud->display_as('activite', 'Activité');
$crud->display_as('recu', 'Reçu');
$crud->display_as('id_from_kids', 'Enfant(s)');
$crud->display_as('commentaire_enfant', 'Commentaire enfant');
$crud->callback_column('accompagniement', array($this, 'accompagniement'));
$crud->callback_column('activite', array($this, 'activite'));
$crud->callback_column('enfant', array($this, 'enfant'));
$crud->required_fields('recu');
$output = $crud->render();
$this->db->where('id_demande', $this->id_demande);
$query = $this->db->get('sos_demande');
if ($query->num_rows == 1) {
$row_demande = $query->row();
}
// $my_demande = $row_demande->id_from_demande;
$menu = new stdClass();
$menu->n3 = true;
//$menu->id_1 = $my_demande;
$menu->id = $row_demande->id_from_femme;
$menu->status = $this->session->userdata('status');
$this->db->where('id_femme', $menu->id);
$query = $this->db->get('sos_femme');
if ($query->num_rows == 1) {
$row_femme = $query->row();
}
$header = $this->navigation->home_f($menu) . ' ' . '<p><pre>' . $row_femme->prenom . ' ' . $row_femme->nom . ' ' . $row_femme->nom_marital . '</pre></p>';
$data = array('output' => $output, 'header' => $header);
$this->_example_output($data);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例3: index
public function index()
{
//Inisialisasi
$crud = new grocery_CRUD();
$crud->set_subject('Pasien');
$crud->set_table('tbl_pasien');
//Label Fields
$crud->display_as('idPasien', 'ID Pasien');
$crud->display_as('namaPasien', 'Nama');
$crud->display_as('umur', 'Umur');
$crud->display_as('tanggalLahir', 'Tanggal Lahir');
$crud->display_as('jenisKelamin', 'Jenis Kelamin');
$crud->display_as('status', 'Status');
$crud->display_as('alamat', 'Alamat');
$crud->display_as('pekerjaan', 'Pekerjaan');
$crud->display_as('no_telp', 'Nomor Telepon');
//Kolom Input dan Callbacks
$crud->fields('idPasien', 'namaPasien', 'umur', 'tanggalLahir', 'jenisKelamin', 'status', 'alamat', 'pekerjaan', 'no_telp');
$crud->field_type('idPasien', 'invisible');
$crud->callback_field('jenisKelamin', array($this, 'jenisKelamin_callback'));
$crud->field_type('status', 'dropdown', array('Menikah' => 'Menikah', 'Belum Menikah' => 'Belum Menikah'));
$crud->field_type('pekerjaan', 'dropdown', array('Pegawai Negeri' => 'Pegawai Negeri', 'Wiraswasta' => 'Wiraswasta', 'Karyawan Swasta' => 'Karyawan Swasta', 'Mahasiswa' => 'Mahasiswa', 'Ibu Rumah Tangga' => 'Ibu Rumah Tangga', 'Pensiunan' => 'Pensiunan', 'Lainnya' => 'Lainnya'));
//Aturan Pengisian Form
$crud->required_fields('namaPasien', 'umur', 'tanggalLahir', 'jenisKelamin', 'status', 'alamat', 'pekerjaan');
$crud->set_rules('umur', 'Umur', array('required', 'max_length[2]', 'numeric'));
$crud->set_rules('no_telp', 'Nomor Telepon', 'numeric');
$crud->set_language("indonesian");
//Cetak Tabel
$output = $crud->render();
$this->_example_output($output);
}
示例4: index
public function index()
{
$bol_del_before_date = $this->m_conndb->dateBeforeDelete();
try {
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('tempahan');
$crud->set_subject('Booking Room');
$crud->set_relation('m_id', 'masa', 'm_desc');
$crud->set_relation('bm_id', 'bilik_meeting', 'bm_desc');
$crud->display_as('t_datereg', 'Date Reg.')->display_as('t_date', 'Book Date')->display_as('t_day', 'Book Day')->display_as('m_id', 'Time')->display_as('t_perkara', 'Club / Item')->display_as('bm_id', 'Meeting Room')->display_as('t_status', 'Status');
$crud->columns('t_date', 't_day', 'm_id', 't_perkara', 'bm_id');
$crud->fields('t_date', 'm_id', 't_perkara', 'bm_id', 't_datereg', 't_day');
$crud->field_type('t_datereg', 'hidden');
$crud->field_type('t_day', 'hidden');
$crud->required_fields('t_date', 'm_id', 't_perkara', 'bm_id');
$umaq = $this->uri->segment(3);
if (!($this->uri->segment(3) && $umaq == 'umaqkacak')) {
$crud->unset_delete();
$crud->unset_edit();
}
$crud->callback_before_insert(array($this, 'setAutoTempahan'));
$output = $crud->render();
$this->viewpage('v_bookroom', $output);
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
}
示例5: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('booking_refunds');
$crud->set_subject('Booking Refund');
$crud->unset_add();
$crud->unset_delete();
// $crud->unset_columns('booking_ref_no');
$crud->unset_fields('booking_ref_no');
$crud->field_type('refund_status', 'dropdown', array('1' => 'Requested', '0' => 'Rejected', '2' => 'Refunded'));
// $crud->field_type('refund_status', 'dropdown', array('1'=>'Requested', '0'=>'Rejected', '2' => 'Refunded'));
// $crud->callback_column('refund_status', function($value, $primary_key){
// $status = array('1'=>'Requested', '0'=>'Rejected', '2' => 'Refunded');
// return $status[$value];
// });
$crud->field_type('item_type', 'readonly');
$crud->callback_column('item_type', function ($value, $primary_key) {
return ucfirst($value);
});
$crud->callback_edit_field('item_type', function ($value, $primary_key) {
return ucfirst($value);
});
// $crud->callback_before_update(array($this, 'modified_date_callback'));
$crud->callback_column('booking_ref_no', array($this, '_show_invoice'));
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Booking Refund', 'pagedesc' => 'Booking Refund', 'contenttitle' => 'Booking Refund List Records');
$this->load->view('gc_admin_wrapper', $data);
}
示例6: perfil
function perfil()
{
$crud = new grocery_CRUD();
$crud->where('row_id', $this->session->userdata('user_id'));
$crud->set_table('usuarios');
$crud->set_theme('datatables');
$crud->set_language('spanish');
$crud->set_subject('Usuario');
$state = $crud->getState();
if ($state == 'list' || $state == 'success') {
redirect('user/dashboard');
} else {
$crud->unset_add();
$crud->unset_delete();
$crud->field_type('usuario', 'readonly');
$crud->field_type('clave', 'password');
$crud->field_type('id_nivel', 'hidden');
$crud->field_type('row_id', 'hidden');
$crud->field_type('id_estatus', 'hidden');
$crud->set_field_upload('foto', 'assets/uploads/users/');
$output = $crud->render();
$data['titulo'] = "Configuración de Usuario";
$this->load->view('include/head');
$this->load->view('include/header');
$this->load->view('include/sidebar');
$this->load->view('admin/main', $data);
$this->load->view('admin/grocery_crud', $output);
$this->load->view('include/footer');
}
}
示例7: especifico
function especifico()
{
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
} else {
$crud = new grocery_CRUD();
//$crud->set_theme('datatables'); // Al comentar esta linea, le pones otro estilo a la tabla.
$crud->set_table('esp_especifico');
$crud->set_subject('Especificos');
$columnas = array('esp_nombre', 'esp_concepto', 'esp_presupuesto_votado', 'esp_modificaciones', 'esp_devengado', 'esp_congelado', 'esp_saldo', 'esp_estado');
$requeridos = array('esp_nombre', 'esp_concepto', 'esp_concepto', 'esp_presupuesto_votado', 'esp_saldo');
$alias = array('esp_nombre' => 'Nombre', 'esp_concepto' => 'Concepto', 'esp_presupuesto_votado' => 'Presupuesto Votado', 'esp_modificaciones' => 'Modificaciones', 'esp_devengado' => 'Devengado', 'esp_presupuesto_mod' => 'Presupuesto Modificado', 'esp_porcentaje_ejecucion' => 'Porcentaje de ejecución', 'esp_observaciones' => 'Observaciones', 'esp_congelado' => 'Congelado', 'esp_saldo' => 'Saldo', 'esp_estado' => 'Estado');
$crud->required_fields($requeridos);
$crud->columns($columnas);
$crud->display_as($alias);
$crud->field_type('esp_usu_mod', 'hidden', $this->tank_auth->get_user_id());
$crud->field_type('esp_fecha_mod', 'hidden', date('Y-m-d H:i:s'));
$crud->field_type('esp_estado', 'dropdown', array('1' => 'Activo', '0' => 'Inactivo'));
// Datos generales de la pagina
$data['menu_sistema'] = true;
$data['vista_name'] = 'inventario/index';
$data['titulo'] = "Subcatalogos";
$data['logo'] = $this->Regional_model->get_parametro("logo");
$info['info_padre'] = $this->sistema_model->get_registro('sio_sistema_opcion', array('sio_id' => 1));
$info['menu_principal'] = $this->sistema_model->get_menu('sic_sistema_catalogo', 1);
$data['menus'] = $this->load->view('menu/opciones_menu', $info, true);
// Estas tres lineas son principales cuando se desea imprimir un Grocery Crud en el sistema
$crud->unset_jquery();
// No llama al jQuery del Grocery Crud
$output = $crud->render();
//$this->load->view('sistema/pais',$output);
$data['texto'] = $this->load->view('inventario/especificos/especifico', $output, true);
$this->__cargarVista($data);
}
}
示例8: index
public function index($categoryid = 0)
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$data['cat_id'] = $categoryid;
// $form_subject = ($categoryid==0 ? "Category" : "Sub Category");
if ($categoryid == 0) {
$form_subject = "Category";
$data['cat_title'] = "Categories";
} else {
$this->category->getTitle($categoryid);
$data['cat_title'] = $this->category->getTitle($categoryid) . " - Sub Categories";
$form_subject = "Sub Category";
}
$crud = new grocery_CRUD();
$crud->set_table('dbx_categories');
$crud->where('pid', $categoryid);
$crud->set_subject($form_subject);
$crud->required_fields('title');
$crud->columns('title');
$crud->callback_column('title', array($this, 'link_title'));
$crud->set_rules('title', 'Title', 'trim|required|xss_clean|is_unique[dbx_categories.title]');
$crud->add_action('Sub Categories', '', '', 'cat-icon', array($this, 'goto_sub'));
$crud->fields('title', 'desc', 'published', 'type', 'pid', 'ownerid', 'created_date');
$crud->field_type('pid', 'hidden', $categoryid);
$crud->field_type('published', 'dropdown', array('0' => 'No', '1' => 'Yes'));
$crud->field_type('type', 'dropdown', array('C' => 'Celebrity', 'M' => 'Movie', 'P' => 'Parent'));
$crud->change_field_type('ownerid', 'invisible');
$crud->change_field_type('created_date', 'invisible');
$crud->callback_before_insert(array($this, 'before_insert'));
$output = $crud->render($data);
$this->load->view('header_view', $data);
$this->load->view('categories_view', $output);
$this->load->view('footer_view', $data);
}
示例9: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('hotels');
$crud->set_subject('Hotels');
$agents = $this->ion_auth->get_all_agents();
$user = $this->ion_auth->user()->row();
$agents += array($user->id => $user->first_name . " " . $user->last_name);
$crud->field_type('hotel_agent_id', 'dropdown', $agents);
//var_dump($agents);
// $crud->set_relation('hotel_agent_id', 'io_users', '{first_name} {last_name}', array('active' => 1));
$crud->display_as('hotel_agent_id', 'Agent Name');
$crud->display_as('hotel_name', 'Hotel Name');
$crud->display_as('hotel_rooms', 'Rooms');
$crud->display_as('hotel_tariffs', 'Tariffs');
$crud->display_as('hotel_country', 'Country');
$crud->display_as('hotel_city', 'City');
$crud->display_as('hotel_street', 'Street');
$crud->display_as('hotel_state', 'State');
$crud->display_as('hotel_postCode', 'PostCode');
$crud->display_as('hotel_phoneNumber', 'Phone Number');
$crud->display_as('hotel_emailId', 'Email ID');
$crud->display_as('hotel_website', 'Website');
$crud->display_as('hotel_facebook', 'Facebook');
$crud->display_as('hotel_googleMap', 'Google Map');
$crud->display_as('hotel_related', 'Related Hotels');
$crud->display_as('hotel_status', 'Status');
$crud->columns('hotel_name', 'hotel_agent_id', 'hotel_phoneNumber', 'hotel_website', 'hotel_facebook', 'hotel_googleMap', 'hotel_status');
$crud->required_fields('hotel_agent_id');
$crud->field_type('hotel_stars', 'dropdown', range(0, 5));
/*
* For related hotels
* on add list all the hotels
* on edit, list all except own name
*/
$hrf = array();
if ($crud->getState() == 'edit') {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1, 'hotel_id !=' => $crud->getStateInfo()->primary_key), 'hotel_id');
} else {
$hrf = $this->generic_model->get_by('hotels', array('hotel_status' => 1), 'hotel_id');
}
$hrf = $this->generic_model->array_from_db($hrf, 'hotel_id, hotel_name');
$crud->field_type('hotel_related', 'multiselect', $hrf);
$crud->callback_column('hotel_image', array($this, 'set_image'));
$crud->set_field_upload('hotel_image', $this->upload_path);
$hf = $this->generic_model->get_by('hotel_facilities', array('hf_status' => 1), 'hf_id');
$hf = $this->generic_model->array_from_db($hf, 'hf_id, hf_facility');
$crud->field_type('hotel_facilities', 'multiselect', $hf);
$hrf = $this->generic_model->get_by('hotel_room_facilities', array('hrf_status' => 1), 'hrf_id');
$hrf = $this->generic_model->array_from_db($hrf, 'hrf_id, hrf_facility');
$crud->field_type('hotel_room_facilities', 'multiselect', $hrf);
$crud->unique_fields('hotel_slug');
$crud->add_action('Photo Gallery', '', 'hotels/gallery', 'ui-icon ui-icon-image');
$output = $crud->render();
$data = array('main_content' => 'list', 'output' => $output, 'pagetitle' => 'Hotels', 'pagedesc' => 'Hotels', 'contenttitle' => 'Hotels List Records');
$this->load->view('gc_admin_wrapper', $data);
}
示例10: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('bootstrap');
$crud->set_table('user');
$crud->set_subject('Gebruiker');
// hide fields
$crud->columns('is_super_user', 'is_active', 'screen_name', 'email', 'gebruikersgroepen');
// new_password and new_password repeat are needed to make formvalidation work
// id is needed to make the email unique check work
$crud->fields('id', 'is_active', 'screen_name', 'email', 'gebruikersgroepen', 'password', 'new_password', 'new_password_repeat');
$crud->required_fields('email', 'screen_name', 'is_active');
$crud->set_relation_n_n('gebruikersgroepen', 'user_x_user_group', 'user_group', 'user_id', 'user_group_id', 'name');
$crud->field_type('id', 'hidden');
$crud->field_type('new_password_repeat', 'hidden');
$crud->field_type('password', 'hidden');
$crud->display_as('is_active', 'Actief');
$crud->display_as('screen_name', 'Schermnaam');
$crud->display_as('is_super_user', '');
$crud->display_as('new_password', 'Wachtwoord');
if ($crud->getState() == 'read') {
$crud->field_type('new_password', 'hidden');
} else {
$crud->callback_field('new_password', array($this, 'edit_field_callback_new_password'));
}
$crud->field_type('is_active', 'dropdown', array('yes' => 'ja', 'no' => 'nee'));
$crud->callback_column('is_active', array($this, 'callback_list_is_active'));
$crud->callback_column('is_super_user', array($this, 'callback_list_is_super_user'));
$crud->callback_before_insert(array($this, 'before_insert_update_callback'));
$crud->callback_before_update(array($this, 'before_insert_update_callback'));
$crud->callback_after_insert(array($this, 'after_insert_callback'));
$crud->callback_after_update(array($this, 'after_update_callback'));
if ($crud->getState() === 'update_validation' or $crud->getState() === 'insert_validation') {
$crud->set_rules('email', 'E-mail', 'required|valid_email|callback_email_unique_check');
$crud->set_rules('screen_name', 'Schermnaam', 'required');
if ($this->input->post('new_password') != '' or !$this->input->post('id')) {
$crud->set_rules('new_password', 'Nieuw wachtwoord', 'required|min_length[10]|matches[new_password_repeat]');
$crud->set_rules('new_password_repeat', 'Herhaal nieuw wachtwoord', '');
}
$this->form_validation->set_message('matches', 'De wachtwoorden zijn niet aan elkaar gelijk.');
}
// 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();
// put the crud content in the right position
$this->views['content'] = $crud_output->output;
$this->css[] = $this->load->view('admin/user/css/index.css', array(), true);
// add javascript and css to make the password generate and change function possible
if ($crud->getState() === 'add' or $crud->getState() === 'edit') {
$this->css[] = $this->load->view('admin/user/css/edit_user.css', array(), true);
$this->javascript[] = $this->load->view('admin/user/js/edit_user.js', array(), true);
}
// create the layout-HTML and show it to the user
$this->_layout();
}
示例11: listarNeumonias
public function listarNeumonias()
{
$sub = $this->frontend_model->buscarDiresas();
$subr = array();
foreach ($sub as $dato) {
$subr[$dato->codigo] = $dato->nombre;
}
$est = $this->frontend_model->listaEstablec();
$estab = array();
foreach ($est as $dato) {
$estab[$dato->cod_est] = $dato->raz_soc;
}
$crud = new grocery_CRUD();
$crud->set_table('neumonias');
$crud->columns('diresa', 'e_salud', 'apepat', 'apemat', 'nombres', 'sexo', 'fecha_reg', 'fecha_def', 'usuario');
$crud->set_subject('Ficha');
$nivelUsuario = $this->session->userdata("nivel");
switch ($nivelUsuario) {
case '8':
$where = array('e_salud' => $this->session->userdata("establecimiento"));
$crud->where($where);
break;
case '7':
$where = array('microred' => $this->session->userdata("microred"), 'red' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '6':
$where = array('red' => $this->session->userdata("red"), 'diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
case '5':
$where = array('diresa' => $this->session->userdata("diresa"));
$crud->where($where);
break;
}
$crud->field_type('sexo', 'dropdown', array('M' => 'Masculino', 'F' => 'Femenino'));
$crud->field_type('diresa', 'dropdown', $subr);
$crud->field_type('e_salud', 'dropdown', $estab);
$crud->display_as("apepat", "Apellido Paterno");
$crud->display_as("apemat", "Apellido Materno");
$crud->display_as("fecha_reg", "Registro");
$crud->display_as("fecha_def", "Defunción");
$crud->display_as("e_salud", "Establecimiento");
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$crud->unset_export();
//$crud->unset_print();
$crud->callback_after_delete(array($this, 'log_usuario_before_delete'));
$crud->add_action_peru('', '', 'RegfichaNeum', 'add-icon');
$crud->add_action('Modificar Ficha', '', 'modulos3/ModfichaNeum', 'edit-icon');
$crud->add_action('Ver Ficha', '', 'modulos3/VerfichaNeum', 'read-icon');
$output = $crud->render();
$this->_example_output($output);
}
示例12: afficheProduit
public function afficheProduit()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('produit');
$crud->set_subject('Produits');
$crud->required_fields('id_Type_Produit', 'prix', 'libelle', 'poids_piece', 'disponibilite');
$crud->display_as('id_Type_Produit', 'Type du produit');
$crud->display_as('poids_piece', 'Poids ou Piece');
$crud->field_type('id_Type_Produit', 'dropdown', array('1' => 'Legumes', '2' => 'Fruits', '3' => 'Epices', '4' => 'Herbes'));
$crud->field_type('poids_piece', 'set', array('poids', 'piece'));
$crud->set_field_upload('file_url', 'assets/uploads/files');
$output = $crud->render();
$this->_example_output($output);
}
示例13: index
function index()
{
if ($this->session->userdata('is_logged_in')) {
$crud = new grocery_CRUD();
$crud->set_table('productos');
//->
$crud->set_theme('datatables');
$crud->set_language('spanish');
$crud->set_subject('Producto');
// Display As
$crud->display_as('id_clasificacion', 'Clasificación');
$crud->display_as('id_estatus', 'Estatus');
//-> Columnas
$crud->columns('descripcion', 'id_clasificacion', 'precio');
// Relaciones
$crud->set_relation('id_clasificacion', 'productos_clasificaciones', 'descripcion');
$crud->set_relation('id_estatus', 'disponible_nodisponible', 'descripcion');
// Upload
##
// Validacion
$crud->field_type('precio', 'integer');
$crud->required_fields('descripcion', 'id_clasificacion', 'precio');
//-> Renderizar
$output = $crud->render();
$data['titulo'] = "PRODUCTOS";
$this->load->view('include/head', $output);
$this->load->view('include/header', $data);
$this->load->view('admin/output');
$this->load->view('admin/librerias');
$this->load->view('include/footer', $data);
} else {
$this->load->view('admin/login');
}
}
示例14: index
public function index()
{
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid2');
/*$crud->fields(
'tabs'
,'title','description','release_year','length','rating','special_features'
,'actors','category'
,'rental_duration','rental_rate','replacement_cost'
);
$tabs = array (
array('Film','title','description','release_year','length','rating','special_features')
,array('Actors-Category','actors','category')
,array('Rental','rental_duration','rental_rate','replacement_cost')
);
$this->session->set_userdata('myproject_film_tabs', $tabs); // Send variables to the callback via session data
$crud->callback_field('tabs',array($this,'_form_tabs')); // Make the fake field */
#Indicamos que tabla se va a usar
$crud->set_table('banners');
#Modificamos el titulo que se muestra en los listados y fomularios
$crud->set_subject('Bannners');
$crud->columns('nombre', 'activo');
$crud->set_rules('nombre', 'Nombre', 'required');
$crud->field_type('activo', 'dropdown', array('S' => 'Si', 'N' => 'No'));
$config = array('main_table' => 'banners', 'main_table_primary' => 'idbanner', "url" => base_url() . __CLASS__ . '/' . __FUNCTION__ . '/', 'ajax_loader' => base_url() . 'assets/img/ajax-loader.gif');
$crud->set_field_upload('archivo', 'assets/uploads/files');
$output = $crud->render();
#Enviamos el resultado a la funcion usuarios_output para que sea pasado a una vista para mostrarlo
$this->_banners_output($output);
}
示例15: consultar
function consultar()
{
if ($this->session->userdata('is_logged_in')) {
$crud = new grocery_CRUD();
$crud->set_table('dolar_hoy');
//->
$crud->set_theme('datatables');
$crud->set_language('spanish');
$crud->set_subject('Dolar Hoy');
// Display As
##
//-> Columnas
$crud->columns('cambio', 'fecha', 'registrado_por', 'registrado_fecha', 'registrado_hora');
// Relaciones
##
// Validacion
$crud->field_type('cambio', 'integer');
$crud->required_fields('cambio', 'id_clasificacion', 'precio');
//-> Renderizar
$output = $crud->render();
$data['titulo'] = "DOLAR HOY";
$this->load->view('include/head', $output);
$this->load->view('include/header', $data);
$this->load->view('admin/output');
$this->load->view('admin/librerias');
$this->load->view('include/footer', $data);
} else {
$this->load->view('admin/login');
}
}